Current News

Moderator: Mmiscool

User avatar
By jlbachiochi
#48730 A bit more information. While I am interested in using serial2, I rewrote this for the primary port and it works as it should
Code: Select allbaudrate 115200
sendstring="Something"

[loop]
cls
wprint "Sending "
wprint sendstring
wprint ", "
wprint "Receiving "

receivestring="Nothing"
serialprintln sendstring
serialbranch [serialin]

wprint receivestring
wprint "<BR>"

timer 2000,[loop]
wait

[serialin]
serialinput receivestring
return


when the appropriate changes are made to use the second port, it does not work.

Code: Select allserial2begin 115200, 4, 5
sendstring="Something"

[loop]
cls
wprint "Sending "
wprint sendstring
wprint ", "
wprint "Receiving "

receivestring="Nothing"
serial2println sendstring
serial2branch [serial2in]

wprint receivestring
wprint "<BR>"

timer 2000,[loop]
wait

[serial2in]
serial2input receivestring
return


When a loopback jumper is used, it should receive what was sent "Something" , however it will print "Nothing" (the default when no serial is received.) I've looked at the pins with a scope and it is coming out TX and going in RX.