Hi people, try-outs continue
I started to try different baud rates with different crystals as below:
4Mhz/2400 - 4Mhz/4800 - 8Mhz/4800 - 8Mhz/9600
But during these changes, of course I need to make some different definitions about serial communication:
Unfortunately none of above succeededCode:'Definitions DEFINE OSC 4 'for 4 Mhz 'DEFINE OSC 8 'for 8 Mhz DEFINE HSER_TXSTA 20h 'I wonder shall I define as DEFINE HSER_TXSTA 24h??? DEFINE HSER_RCSTA 90h 'same for all DEFINE HSER_BAUD 2400 'for 2400 Baud rate 'DEFINE HSER_BAUD 4800 'for 4800 Baud rate 'DEFINE HSER_BAUD 9600 'for 9600 Baud rate DEFINE HSER_SPBRG 25 'for 4Mhz/2400 & 8Mhz/4800 with an error %0.16 'DEFINE HSER_SPBRG 12 'for 4Mhz/4800 & 8Mhz/9600 with an error %0.16 DEFINE HSER_CLROERR 1 'same for all 'Initialization TRISB=%00000000 PORTB=%00000000 'Program Starts BEGIN: PORTB = 0 HIGH PORTB.7 PAUSE 1000 LOW PORTB.7 HIGH PORTB.6 HSEROUT ["AT",13] 'send AT to modem followed by a CR and line feed HSERIN 5000, BEGIN, [WAIT("OK")] 'now wait for 5secs until OK is received however HIGH PORTB.5 PAUSE 500 GOTO BEGIN 'if it is not then goto the SMS routine again 'END End![]()





Bookmarks