Code:DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 DEFINE HSER_CLROERR 1 ' Clear overflow automatically DEFINE HSER_SPBRG 225 ' 9600 Baud @ 48MHz, 0,0% SPBRGH = 4 BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
the above lines cured all my serial in problems.
I think the last 3 were the important bits, but now when the buffer fills it just ignores extra chars etc, no more ''going deaf''
using them with
And a 20mhz crystal gives trouble free operation to the phone/module, and no issue with the 3v signals.Code:__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H __CONFIG _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_ON_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
I had to remove the resistor/led combination from the rx pin, it was loading the module a little and dropping its voltage down too low to be seen by the pic, but with a direct connection transfers have been error free. (measured on voltmeter as 2.8v, 2.75 and bits go missing...)
Thanks to everyone for there input and ideas, I dont know where I would have been without you all this last few weeks!




Bookmarks