hserin/hsersetup@28x1

MORA99

Senior Member
Have anyone gotten herserin to work with internal picaxe datacomm ?

I tried the exsample from the datasheets, the test led flashes fine, and the 28x1 prints "main: " all the time, but nothing else happens.
<code><pre><font size=2 face='Courier'>
#picaxe 28x1

hsersetup B4800_8, %00

main:
SerTxd(&quot;Main: &quot;,@ptr,CR,LF )
hserin [1000,main],0,4&#8216; receive 4 bytes into sp
ptr = 0&#8216; reset sp pointer
hserout 0,(@ptrinc,@ptrinc,@ptrinc,@ptr)&#8216; echo out
goto main&#8216; loop
</font></pre></code>


<code><pre><font size=2 face='Courier'>
#picaxe 14m

b1=1
b2=10
b3=20
b4=30


do
serout 5,N4800_8,(b1,b2,b3,b4)
'Have tried T4800_8 too
toggle 4
pause 1000
b1=b1+1
b2=b2+1
b3=b3+1
b4=b4+1
loop


</font></pre></code>

Edited by - MORA99 on 19/06/2007 22:40:02
 

hippy

Ex-Staff (retired)
I'd take a step back and start with something simple and build up.

Firstly get single bytes from the 14M to 28X1 using SEROUT/SERIN to prove the hardware, then check multiple bytes.

Then back to single bytes and no fancy @ptr stuff using HSERIN. Then multiple bytes, then, only after all that, introduce @ptr handling.

I'd also add something which indicated whether the SERTXD was being executed because the HSERIN timedout out or after it had received data.

You should also set the HSERIN timeout to longer than the rate at which the 14M puts data out. Otherwise you'll likely have no end of problems with things timing out and only partial data packets received.
 
Top