Apologize for poor english , i was a bad boy at school ...
Vincent
don't be afraid of that...
Everything is ok in both speed, but i can't switch from one to another ...
It seems that new define are not allowed during execution ...
And writing to regsiter seems to confuse HSEROUT ...
can you something for me. I'm not sure it's gonna work but... worth a try 
Let's assume you have a 20MHZ crystal.
Refer to the table 10-4:
SPBRG=129 '@9600 bauds
SPBRG=64 '@19200 bauds
IMO we can change the baud rate only by changing the value of the SPBRG register.
so give a try to this snipet
Code:
DEFINE OSC 20
start:
TXSTA=$24
RCSTA=$90
SPBRG=129 '@9600 bauds
pause 100 'try to remove this pause after
HSEROUT ["comm @9600 bauds"]
TXSTA=$24
RCSTA=$90
SPBRG=64 '@19200 bauds
PAUSE 5000 'wait 5 seconds
HSEROUT ["comm @19200 bauds"]
goto start
let me know... i'm curious.
If it's working, try to define TXSTA and RCSTA only one time at the begining to see if it's also work.
Code:
DEFINE OSC 20
TXSTA=$24
RCSTA=$90
start:
SPBRG=129 '@9600 bauds
pause 100 'try to remove this pause after
HSEROUT ["comm @9600 bauds"]
SPBRG=64 '@19200 bauds
PAUSE 5000 'wait 5 seconds
HSEROUT ["comm @19200 bauds"]
goto start
Last edited by mister_e; - 2nd February 2005 at 18:09.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks