Huh, look at that, HSEROUT is for the USART. Glad you said that, I'm reading the book on SEROUT and going in circles with interupts messing with SERIN/OUT.
I'll see what I can get going with HSEROUT. I'm sure I'll have more questions as I progress. At least I'm not just trying random settings any more, that's progress!!!
Thanks,
Shane
OK, HSEROUT is working, and so is the timer interupt. After almost 30 minutes, it was slow about 20 seconds. I'm guessing that could be drift in the internal OSC? It's all I'll need for the current project.
I used the HSEROUT settings from the PBP manual, I compaired them to the data sheet for the 18F2550, I didn't see anything that I felt like I should change. Learned my lesson with the T1CON settings.
Thanks for the help.
For those reading this that are worried about changing from Debug to HSEROUT, it wasn't bad, I used the following Defines:
The HSEROUT looks like this:Code:DEFINE HSER_RCSTA 90h DEFINE HSER_TXSTA 20h DEFINE HSER_BAUD 9600 DEFINE HSER_CLROERR 1
I'm using the "Serial Communicator" in MicroCode Studio (F4 key)Code:Hserout [10," M: ",dec Minutes," S: ",dec Seconds," T: ",dec Ticks,10]
The pic is connected to a MAX232, I think this is needed for HSEROUT? Someone correct me if I'm wrong.
Also I'm using a DYNEX RS232 to USB adapter:
Model: DX-UBDB9 from BestBuy
I'm Using Windows VISTA, so I downloaded the latest drivers from their website, and only had moderate issues with VISTA ( mostly operator error )
Hope this helps out anyone else that has questions about a setup.
Shane
Using the internal OSC sure leads to problems one day or another, even with newer OSC accuracy.
@8MHz and 9600 baud, it shouldn't matter if you use 24, or 20 for TXSTA as both will return the same error %... BUT assuming some ASM limitations, asking PBP macro to calculate the SPBRG value for you, could give some difference at this point.
See what a single digit of difference can do
@8MHz and TXSTA=20,
if SPBRG=11, err% =8.507%
if SPBRG=12, err% =0.16
if SPBRG=13, err% = -6.994%
When TXSTA=24
if SPBRG=50, err% =2.124%
if SPBRG=51, err% =0.16
if SPBRG=52, err% =-1.73%
Play safe and set SPBRG yourself.
This is where I begun to think about some Standalone Calc software. First was E-Z SPBRG Calculator, then it grows and became PicMultiCalc.Code:DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0 DEFINE HSER_SPBRG 12 ' 9600 Baud @ 8MHz, 0.16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically
Download it
http://www.picbasic.co.uk/forum/atta...7&d=1225550328
Last edited by mister_e; - 11th May 2009 at 18:08.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks