well after fiddling and some reading of the datasheet - yes i am slake sometimes
the following setting were applied and work
one thing is clear is that the serial ports setting applied worked only when i used the setting based on the core base osc speed of 1mhz , not the 4mhz which is applied with the PPL
this seems to hold up true also settings with timer 0
it sort of make me think that the PPL is not looked at with core timing features of the chip , but i know this is not true when using it at 32 and 64,
anyone can explain this to me be great
cheers
Sheldon
Code:
DEFINE OSC 4 ' Timing referance for pause , pauseus commands
DEFINE ADC_BITS 12 ' Number of bits in ADCIN result - Required for adcin command
DEFINE PULSIN_MAX 2000 ' Maximum counts( clock ticks) allowed before pulsin times out( 2000 ^ 1.25us = 2.5 ms)
DEFINE HSER_PORT 2 ' Hser port 2 use
DEFINE HSER2_RCSTA 90h ' Hser2 receive status init
DEFINE HSER2_TXSTA 24h ' Hser2 transmit status init ( BIT2 -BRGH 1= HI SPEED, 0= LOW SPEED )
DEFINE HSER2_CLROERR 1 ' Clear overflow automatically
DEFINE HSER2_BAUD 19200 ' Hser2 baud rate
DEFINE HSER2_SPBRG 12 ' 19200 Baud @ SPBRGH = 12 0.16% error
BAUDCON2.3 = 1 ' set BRG16 = 1 - 16BIT/ASYNC
Bookmarks