I am working on the harware serial send/receive. I discovered some strange behavior - below is the code, running on a 28X1, firmware A.0:
<code><pre><font size=2 face='Courier'>
hsersetup B19200_4, %10 ' negative polarity; foreground receive
hserout 0, ("Hello World!", cr, lf)
b0 = 90
myloop:
hserout 0, (#b0, cr, lf)
sertxd (#b0, cr, lf)
inc b0
pause 300
goto myloop
</font></pre></code>
The serial tx pin (IN6 on the Picaxe 28X1) is connected directly to my laptop's serial port. The 28X1 is running off Vcc=5V. On first glance, everything looks smooth - I can see the "Hello world" as well as the numbers appear on the terminal window in the programming editor (yes, I did move the cable to the hardware serial pins). But numbers 100 to 109 get printed wrong - the center "0" ios missing (i.e. "17" instead of "107). Lower and higher numbers print fine. Also, the sertxd output doesn't have that behavior.
I also tried inserting a DS276 (similar to the standard Maxim tranceivers, but uses less (= no) external components, I'm hoping to produce a super-simple setup with that.) to invert and buffer the data (obviously the flag in hsersetup then changes from %10 to %00 and you have to add a "high portc 6; pause 400" before sending the "Hello world". Still the same result.
Reducing the baud rate didn't help either.
Could anybody confirm that behavior? (Technical?).
Thanks,
Wolfgang
Edited by - womai on 30/08/2007 19:23:08
<code><pre><font size=2 face='Courier'>
hsersetup B19200_4, %10 ' negative polarity; foreground receive
hserout 0, ("Hello World!", cr, lf)
b0 = 90
myloop:
hserout 0, (#b0, cr, lf)
sertxd (#b0, cr, lf)
inc b0
pause 300
goto myloop
</font></pre></code>
The serial tx pin (IN6 on the Picaxe 28X1) is connected directly to my laptop's serial port. The 28X1 is running off Vcc=5V. On first glance, everything looks smooth - I can see the "Hello world" as well as the numbers appear on the terminal window in the programming editor (yes, I did move the cable to the hardware serial pins). But numbers 100 to 109 get printed wrong - the center "0" ios missing (i.e. "17" instead of "107). Lower and higher numbers print fine. Also, the sertxd output doesn't have that behavior.
I also tried inserting a DS276 (similar to the standard Maxim tranceivers, but uses less (= no) external components, I'm hoping to produce a super-simple setup with that.) to invert and buffer the data (obviously the flag in hsersetup then changes from %10 to %00 and you have to add a "high portc 6; pause 400" before sending the "Hello world". Still the same result.
Reducing the baud rate didn't help either.
Could anybody confirm that behavior? (Technical?).
Thanks,
Wolfgang
Edited by - womai on 30/08/2007 19:23:08