Simple Debug object
Unsoundcode
Posts: 1,532
I am finding the Prop easy to get into and see it has potential for complexity beyond my scope. Because I find it easy I enjoy and because I enjoy I learn faster.
I am at a small hurdle at the moment using the SimpleDebug object in conjunction with the FullDuplex object on a USB Propstick. This is my code that interfaces with the serial objects
obj port:"SimpleDebug"
PUB main
port.start(4800)
repeat
· port.dec(1)
· waitcnt(6_000_000+cnt)
port.stop
The values I see at the terminal are 0=144 , 1=145 , 2=146 etc etc so the values are incrementing by one but not what I would expect.·Are there any ideas on what I am doing wrong.
I have seen other serial objects in the object exchange and will be trying them soon I wanted to get by this one first.
thanks
Jeff T.
I am at a small hurdle at the moment using the SimpleDebug object in conjunction with the FullDuplex object on a USB Propstick. This is my code that interfaces with the serial objects
obj port:"SimpleDebug"
PUB main
port.start(4800)
repeat
· port.dec(1)
· waitcnt(6_000_000+cnt)
port.stop
The values I see at the terminal are 0=144 , 1=145 , 2=146 etc etc so the values are incrementing by one but not what I would expect.·Are there any ideas on what I am doing wrong.
I have seen other serial objects in the object exchange and will be trying them soon I wanted to get by this one first.
thanks
Jeff T.
Comments
thanks
Jeff T.
So please state your crystal and - for 4800 baud - a clockrate of at least 20 MHz (but 80 Mhz would be better of course).
Also change the wait time: It is best to derive it from the internal variable CLKFRQ which comes to one second.
I am sure it will work immediately.
Post Edited (deSilva) : 10/25/2007 5:42:25 PM GMT
Jeff T.