ON 20070714@2:26:10 AM at page: http://www.piclist.com/techref/member/SS-sss-H52/index.htm#39277.1015046296 Sameer Sathe[SS-sss-H52] Says ON 20070714@2:31:11 AM at page: http://www.piclist.com/techref/member/SS-sss-H52/index.htm#39277.1049884259 Sameer Sathe[SS-sss-H52] Code:
This 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'. ;-------------------------------------------------------------------------------------- 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 GOTO MES_SETPOINTON 20070714@2:34:22 AM at page: http://www.piclist.com/techref/member/SS-sss-H52/index.htm#39277.1015046296 Sameer Sathe[SS-sss-H52] removed post 39277.1015046296 |Delete '
' ON 20070714@2:36:39 AM at page: http://www.piclist.com/techref/member/SS-sss-H52/index.htm# Sameer Sathe[SS-sss-H52] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\SS-sss-H52\index.htm&version=5 ON 20070714@2:47:41 AM at page: http://www.piclist.com/techref/member/SS-sss-H52/index.htm# Sameer Sathe[SS-sss-H52] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\SS-sss-H52\index.htm&version=6