Hi all,
Im sort of new to Picaxe. I was trying to send some serial data from my 28X to the coms port. What I was trying to achieve was to send a string to ask for a number. That number would then be used as a counter limit to flash an LED. I couldnt get it running but i also noticed that on my coms to USB dongle the Rx LED stays constantly ON. May be its not letting any data back in. I am using a MAX 232 converter in the middle. Also the CTS and RTS have been grounded and Im using an 8MHz Clock. I have already seen all the other links related to the Serial Coms, but i dont see the problem. I sure im missing out on a small bit... Its always the case. Heres the code:
;Connections:
;Pin Out1 to SerTx
;Pin Out2 to LED
;Pin Out3 to SerRX
;-----------------------
main:
let b1 = 0
let b2 = 0
serout 1, N4800,("Please Enter The Number Of Times You Want The LED To Flash: ")
pause 250
datain:
serin 3,n4800, b2
wait 2
datacheck:
if b2 > b1 then goto flash
goto datacheck
flash:
for b3=0 to b2
high 2
wait 2 ; with 8 MHz clock the cycle is half the requested time, Hence 1 Sec.
low 2
wait 2
serout 1,N4800,("LED Flashing from 1 to : ",#b3,lf)
next b3
serout 1,N4800,("LED Flash Complete ",lf)
pause 500
goto main
Hope this helps
Thanx
Im sort of new to Picaxe. I was trying to send some serial data from my 28X to the coms port. What I was trying to achieve was to send a string to ask for a number. That number would then be used as a counter limit to flash an LED. I couldnt get it running but i also noticed that on my coms to USB dongle the Rx LED stays constantly ON. May be its not letting any data back in. I am using a MAX 232 converter in the middle. Also the CTS and RTS have been grounded and Im using an 8MHz Clock. I have already seen all the other links related to the Serial Coms, but i dont see the problem. I sure im missing out on a small bit... Its always the case. Heres the code:
;Connections:
;Pin Out1 to SerTx
;Pin Out2 to LED
;Pin Out3 to SerRX
;-----------------------
main:
let b1 = 0
let b2 = 0
serout 1, N4800,("Please Enter The Number Of Times You Want The LED To Flash: ")
pause 250
datain:
serin 3,n4800, b2
wait 2
datacheck:
if b2 > b1 then goto flash
goto datacheck
flash:
for b3=0 to b2
high 2
wait 2 ; with 8 MHz clock the cycle is half the requested time, Hence 1 Sec.
low 2
wait 2
serout 1,N4800,("LED Flashing from 1 to : ",#b3,lf)
next b3
serout 1,N4800,("LED Flash Complete ",lf)
pause 500
goto main
Hope this helps
Thanx