Como me recomendaron lo prove al circuito en fisico por lo cual tuve algunas respuestas inesperadas que en el simulador de proteus no ocurian ... les dejo a continuacion las imagenes del osciloscopio . , del circuito y el programa modificado a ver que opinan

;
Cosas a observar :
La señal de SCK es erronea
El circuito no esta completo , solo envio desde el maestro 0x0f y en el esclavo testeo que bit esta encendido y lo mando a los 4 leds que se ven en el circuito pero solo se enciende uno en la realidad por lo cual la data que llega al esclavo y este procesa es erronea , por deduccion .. uds me diran si es asi o no ...





MAestro :
;******************************************************************************
; This file is a basic code template for code generation *
; on the PIC16F88. This file contains the basic code building *
; blocks to build upon. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler. *
; *
; Refer to the respective data sheet for additional *
; information on the instruction set. *
; *
;******************************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
;******************************************************************************
; *
; Files Required: P16F88.INC *
; *
;******************************************************************************
; *
; Features of the 16F88: *
; *
; 1 10-bit PWM *
; 8 MHz Internal Oscillator *
; ICD support *
; 256 bytes of EEPROM data memory *
; Capture/Compare Module *
; *
;******************************************************************************
; *
; Notes: *
; *
; *
;******************************************************************************
; *
; Revision History: *
; *
;******************************************************************************
;------------------------------------------------------------------------------
; PROCESSOR DECLARATION
;------------------------------------------------------------------------------
LIST p=16F88 ; list directive to define processor
#INCLUDE <P16F88.INC> ; processor specific variable definitions
;------------------------------------------------------------------------------
;
; CONFIGURATION WORD SETUP
;
; The 'CONFIG' directive is used to embed the configuration word within the
; .asm file. The lables following the directive are located in the respective
; .inc file. See the data sheet for additional information on configuration
; word settings.
;
;------------------------------------------------------------------------------
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
;------------------------------------------------------------------------------
;
; VARIABLE DEFINITIONS
;
; Available Data Memory divided into Bank 0 through Bank 3. Each Bank contains
; Special Function Registers and General Purpose Registers at the locations
; below:
;
; SFR GPR SHARED GPR's
; Bank 0 0x00-0x1F 0x20-0x6F 0x70-0x7F
; Bank 1 0x80-0x9F 0xA0-0xEF 0xF0-0xFF
; Bank 2 0x100-0x10F 0x110-0x16F 0x170-0x17F
; Bank 3 0x180-0x18F 0x190-0x1EF 0x1F0-0x1FF
;
;------------------------------------------------------------------------------
CBLOCK 0x20 ; Sample GPR variable registers allocated contiguously
MYVAR1 ; User variable
MYVAR2 ; User variable
MYVAR3 ; User variable
ENDC
Ctr0 EQU 0x20 ; Counter variable - sent to SPI
Dly0 EQU 0x21 ; Delay Variable (low byte)
Dly1 EQU 0x22 ; Delay Variable (high byte)
#define CS 0x02 ; PORTA,2
W_TEMP EQU 0x7D ; w register for context saving (ACCESS)
STATUS_TEMP EQU 0x7E ; status used for context saving (ACCESS)
PCLATH_TEMP EQU 0x7F ; variable used for context saving
;------------------------------------------------------------------------------
; EEPROM INITIALIZATION
;
; The 16F88 has 256 bytes of non-volatile EEPROM, starting at address 0x2100
;
;------------------------------------------------------------------------------
DATAEE ORG 0x2100
DE "MCHP" ; Place 'M' 'C' 'H' 'P' at address 0,1,2,3
;------------------------------------------------------------------------------
; RESET VECTOR
;------------------------------------------------------------------------------
RESET ORG 0x0000 ; processor reset vector
PAGESEL START
GOTO START ; go to beginning of program
;------------------------------------------------------------------------------
; INTERRUPT SERVICE ROUTINE
;------------------------------------------------------------------------------
ISR ORG 0x0004 ; interrupt vector location
; Context saving for ISR
MOVWF W_TEMP ; save off current W register contents
MOVF STATUS,W ; move status register into W register
MOVWF STATUS_TEMP ; save off contents of STATUS register
MOVF PCLATH,W ; move pclath register into W register
MOVWF PCLATH_TEMP ; save off contents of PCLATH register
;------------------------------------------------------------------------------
; USER INTERRUPT SERVICE ROUTINE GOES HERE
;------------------------------------------------------------------------------
; Restore context before returning from interrupt
MOVF PCLATH_TEMP,W ; retrieve copy of PCLATH register
MOVWF PCLATH ; restore pre-isr PCLATH register contents
MOVF STATUS_TEMP,W ; retrieve copy of STATUS register
MOVWF STATUS ; restore pre-isr STATUS register contents
SWAPF W_TEMP,F
SWAPF W_TEMP,W ; restore pre-isr W register contents
RETFIE ; return from interrupt
;------------------------------------------------------------------------------
; MAIN PROGRAM
;------------------------------------------------------------------------------
START ; Set up the SPI Support
BANKSEL TRISA ; BANK 1
movlw 0x00 ; Set PORTA as
movwf TRISA ; all Outputs
movlw 0x01 ; Turn off A/D
movwf ADCON0 ; so PORTA can be used
; Set up the SPI Port
BANKSEL TRISB ; BANK 1
movlw 0x02 ; SCK is output (Master), SDI is input,
movwf TRISB ; SDO is output, all others output
movlw 0x40 ; Mode 1,1 SPI, middle of output
movwf SSPSTAT ; time sampling
BANKSEL SSPCON ; BANK 0
movlw 0x31 ; Mode 1,1 SPI Master Mode, 1/16 Tosc bit
time
movwf SSPCON ; SSP is on
Send_DT
bcf PORTA,CS ; Enable Chip Select Output (low)
CALL RUTINE
movlw 0x0F
movwf SSPBUF ; put in SSPBUF
BANKSEL SSPSTAT ; BANK 1
Char1 btfss SSPSTAT,BF ; Data transfer complete? (Buffer Full?)
goto Char1 ; if not, check again
BANKSEL SSPBUF ; BANK0
movf SSPBUF,W ; Get Data from SSPBUF
; ; Throw it away
bsf PORTA,CS ; Disable Chip Select Output (high)
Update_Test_Counter
incf Ctr0,F ; Increment counter variable
Delay movlw 0x01 ; Simple Delay loop
movwf Dly1 ; |
movlw 0x0F ; |
movwf Dly0 ; |
DlyLoop decfsz Dly0,F ; |
goto DlyLoop ; |
decfsz Dly1,F ; |
goto DlyLoop ; |
; Done Delay ; \_/
DoAgain goto Send_DT ; Done, Send Next Byte.
RUTINE
return
;------------------------------------------------------------------------------
; PLACE USER PROGRAM HERE
;------------------------------------------------------------------------------
GOTO $
END
Esclavo :
;******************************************************************************
; This file is a basic code template for code generation *
; on the PIC16F88. This file contains the basic code building *
; blocks to build upon. *
; *
; Refer to the MPASM User's Guide for additional information on *
; features of the assembler. *
; *
; Refer to the respective data sheet for additional *
; information on the instruction set. *
; *
;******************************************************************************
; *
; Filename: xxx.asm *
; Date: *
; File Version: *
; *
; Author: *
; Company: *
; *
;******************************************************************************
; *
; Files Required: P16F88.INC *
; *
;******************************************************************************
; *
; Features of the 16F88: *
; *
; 1 10-bit PWM *
; 8 MHz Internal Oscillator *
; ICD support *
; 256 bytes of EEPROM data memory *
; Capture/Compare Module *
; *
;******************************************************************************
; *
; Notes: *
; *
; *
;******************************************************************************
; *
; Revision History: *
; *
;******************************************************************************
;------------------------------------------------------------------------------
; PROCESSOR DECLARATION
;------------------------------------------------------------------------------
LIST p=16F88 ; list directive to define processor
#INCLUDE <P16F88.INC> ; processor specific variable definitions
;------------------------------------------------------------------------------
;
; CONFIGURATION WORD SETUP
;
; The 'CONFIG' directive is used to embed the configuration word within the
; .asm file. The lables following the directive are located in the respective
; .inc file. See the data sheet for additional information on configuration
; word settings.
;
;------------------------------------------------------------------------------
__CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _INTRC_IO
__CONFIG _CONFIG2, _IESO_OFF & _FCMEN_OFF
;------------------------------------------------------------------------------
;
; VARIABLE DEFINITIONS
;
; Available Data Memory divided into Bank 0 through Bank 3. Each Bank contains
; Special Function Registers and General Purpose Registers at the locations
; below:
;
; SFR GPR SHARED GPR's
; Bank 0 0x00-0x1F 0x20-0x6F 0x70-0x7F
; Bank 1 0x80-0x9F 0xA0-0xEF 0xF0-0xFF
; Bank 2 0x100-0x10F 0x110-0x16F 0x170-0x17F
; Bank 3 0x180-0x18F 0x190-0x1EF 0x1F0-0x1FF
;
;------------------------------------------------------------------------------
CBLOCK 0x20 ; Sample GPR variable registers allocated contiguously
MYVAR1 ; User variable
MYVAR2 ; User variable
MYVAR3 ; User variable
ENDC
#define CS 0x20 ; PORTA,5 (HW SS pin)
W_TEMP EQU 0x7D ; w register for context saving (ACCESS)
STATUS_TEMP EQU 0x7E ; status used for context saving (ACCESS)
PCLATH_TEMP EQU 0x7F ; variable used for context saving
;------------------------------------------------------------------------------
; EEPROM INITIALIZATION
;
; The 16F88 has 256 bytes of non-volatile EEPROM, starting at address 0x2100
;
;------------------------------------------------------------------------------
DATAEE ORG 0x2100
DE "MCHP" ; Place 'M' 'C' 'H' 'P' at address 0,1,2,3
;------------------------------------------------------------------------------
; RESET VECTOR
;------------------------------------------------------------------------------
RESET ORG 0x0000 ; processor reset vector
PAGESEL START
GOTO START ; go to beginning of program
; MAIN PROGRAM
;------------------------------------------------------------------------------
START
clrf PORTB
CLRF PORTA
; Set up the SPI Support
BANKSEL TRISA ; BANK 1
movlw CS ; Chip Select pin
movwf TRISA ; is in input mode
movlw 0x06 ; Turn Off A/D mode for at least the
movwf ADCON1 ; Chip Select pin (all Digital mode)
; Set up output port
BANKSEL TRISB ; BANK 1
movlw b'00110010' ; Configure all PORTB pins
movwf TRISB ; to be in output mode
BANKSEL PORTA
CLRF PORTA
BANKSEL TRISB
; Set up the SPI
movlw 0x40 ; Mode 1,1 SPI with
movwf SSPSTAT ; middle of output time sampling
BANKSEL SSPCON ; BANK 0
movlw 0x34 ; Mode 1,1 SPI Slave Mode, /SS Required
movwf SSPCON ; SSP is on
Chk4Dat
btfss SSPSTAT,BF ; Here is the test
goto Chk4Dat ; New data, do a transfer (below
Recibed
BANKSEL SSPBUF
movf SSPBUF,W
MOVWF MYVAR2 ; put in SSPBUF into W
CALL UNOS
CALL DOS
CALL TRES
CALL CUATRO
BANKSEL PORTB ; BANK 0
movwf PORTB ; Show the results on PORTB
CALL ENVIOSLAVE
DoAgain
; Optional customer code can go here
goto Chk4Dat ; Receive Next Byte
UNOS BTFSS MYVAR2,0
BCF PORTA,1
BSF PORTA,1
RETURN
DOS BTFSS MYVAR2,1
BCF PORTB,5
BSF PORTB,5
RETURN
TRES BTFSS MYVAR2,2
BCF PORTB,6
BSF PORTB,6
RETURN
CUATRO BTFSS MYVAR,3
BCF PORTB,7
BSF PORTB,7
RETURN
ENVIOSLAVE
MOVLW 0XFF
MOVWF MYVAR1
MOVLW MYVAR1
MOVWF SSPBUF
RETURN
;------------------------------------------------------------------------------
; PLACE USER PROGRAM HERE
;------------------------------------------------------------------------------
GOTO $
END
Desde ya gracias por la ayuda gente !!