ON 20070707@10:08:55 PM at page: http://www.piclist.com/microchip/spi.htm#39269.9639699074 James Newton[JMN-EFP-786] removed post 39269.9639699074 |Delete 'kapil@qdnet.com asks:
Dear sir
I am interfacing two microcontroller(18f6722(master)& 18f252(slave)) using SPI.Data received on the slave but not display on LCD.Please suggest me
his is the code to actually enter the code into mcu via USART , it will only accept the code unless & until u only press capital 'S'. Without using any Interrupt , its a pooling type code ;-------------------------------------------------------------------------------------- USART_REC BANKSEL PIR1 btfss PIR1,RCIF ; Test for received data flag GOTO USART_REC_returns BTFSC RCSTA,OERR goto overerror ; check for over run error BTFSC RCSTA,FERR GOTO frameerror ; CHECK FOR FRAMING ERROR movf RCREG,W ; Store data in W MOVWF HAULT_KEY goto HAULT_DECIDE overerror bcf rcsta,cren ;pulse cren off... movf rcreg,w ;flush fifo movf rcreg,w ; all three elements. movf rcreg,w bsf rcsta,cren ;turn cren back on. ;this pulsing of cren ;will clear the oerr flag. ;enable interrupts. goto USART_REC ;try again... frameerror movf rcreg,w ;reading rcreg clears ferr flag. bsf intcon,gie ;enable interrupts. goto USART_REC ;try again... ;-------------------------------------------------------------------------------------------- HAULT_DECIDE ; CHECK IF THE KEY PRESSED ID 'S' OR RESUME NORMAL SEND DATA FUNCTION MOVLW 0X53 ; capital S SUBWF HAULT_KEY BTFSS STATUS,C goto USART_REC_returns BTFSS STATUS,Z goto USART_REC_returns continue to key enter routineON 20070714@3:06:13 AM at page: http://piclist.com/techref/microchip/rs232.htm#39277.1293171296 Sameer Sathe[SS-sss-H52] Code:
his is the code to actually enter the code into mcu via USART , it will only accept the code unless & until u only press capital 'S'. Without using any Interrupt , its a pooling type code ;-------------------------------------------------------------------------------------- USART_REC BANKSEL PIR1 btfss PIR1,RCIF ; Test for received data flag GOTO USART_REC_returns BTFSC RCSTA,OERR goto overerror ; check for over run error BTFSC RCSTA,FERR GOTO frameerror ; CHECK FOR FRAMING ERROR movf RCREG,W ; Store data in W MOVWF HAULT_KEY goto HAULT_DECIDE overerror bcf rcsta,cren ;pulse cren off... movf rcreg,w ;flush fifo movf rcreg,w ; all three elements. movf rcreg,w bsf rcsta,cren ;turn cren back on. ;this pulsing of cren ;will clear the oerr flag. ;enable interrupts. goto USART_REC ;try again... frameerror movf rcreg,w ;reading rcreg clears ferr flag. bsf intcon,gie ;enable interrupts. goto USART_REC ;try again... ;-------------------------------------------------------------------------------------------- HAULT_DECIDE ; CHECK IF THE KEY PRESSED ID 'S' OR RESUME NORMAL SEND DATA FUNCTION MOVLW 0X53 ; capital S SUBWF HAULT_KEY BTFSS STATUS,C goto USART_REC_returns BTFSS STATUS,Z goto USART_REC_returns continue to key enter routineON 20070716@11:11:08 AM at page: http://www.piclist.com/techref/microchip/osc.htm#39279.4660648148 James Newton[JMN-EFP-786] archive reference /techref/postbot.asp?by=time&id=piclist/2007/06/21/180730a List post "results of 20MHz resonator tests" 2007 \ 06 \ 21 testing of several resonators on a PCB with two PICs. Master PIC is a 16F876A set to HS mode. Slave is a ON 20070718@11:22:20 AM at page: http://www.piclist.com/microchip/routines.htm#39280.9500347222 James Newton[JMN-EFP-786] Published and replied to post 39280.9500347222 by vimalrajs |Insert 'That depends on the C compiler and should be documented by the compiler vendor.' at: '' vimalrajs@aol.in " how to access the port in Pic 16F877A in C Code" |Delete 'P-' before: '' but after: 'rajeshd@spanwave.com refers to
/techref/microchip/isrdelaycomp.htm i want to create 3 pattern of pwm signal ,how its possible?'
example , 1st signal-total time is 2us ,ontime .25us
2nd signal-total time is 1701us,ontime 1us
3rd signal-total time is 1701us,ontime 1us