Forum unknown
· SoftwareDevelopment
Serial.Device (HELP!!)
7 messages in this thread
Hey Folks… I've been struggling trying to fix a bug(ette) [nice word
that!!] in my Terminal program? It involves DoIO, which I'm using to output
characters to the serial.device in the usual way (CMD_WRITE). However,
it'll work fine as many times as I call it… I can go on forever sending
single-characters to the device using DoIO. My problem arises when I send
them TOO FAST!! (at least I *THINK* thats whats causing the problem). It
FReezes up, inside the DoIO call, and doesn't even return with an error. Ie:
It never gets back from the DoIO at all, if I send stuff to the serial port
too fast! Anyone know if there's a reason why it can't keep up with me!???
Any ideas what I should do to wait for it to be ready!?
I assumed that DoIO shouldn't return until its completed, so I assume that
I can go send another character as soon as OI've been returned from the DoIO
of the last character. This bug is most annoying. I dont even know if the
bug is *MY* fault or the Serial.Device's fault!!
Also, I've had many other hassles involved in writing this term prog..
due to it being in machine code rather than C. No documentation exists for
how to CreatePort (a message port) from machine code..!
The CALL doesn't even exist, so I had to guess my way around it, using
'AddPort'. Not even sure if I was right, but it seems to work! I'll be
uploading the Source to this terminal prog as soon as I get it 100% working!
Can anyone put me out of my misery? — Jez.
Well, since you're down in machine code, why not talk directly to the serial
port. It's easy! Alternatively, you could poll the 'send buffer empty' flag to
see when the character is finished.
Well, since you're down in machine code, why not talk directly to the serial
port. It's easy! Alternatively, you could poll the 'send buffer empty' flag to
see when the character is finished.
Jez, Just a thought – Since DoIO waits for completion before waking up your
task, probably the definition of a "completed" task to SER: involves having
the characters removed from the buffer. Possibly they aren't being removed
quick enough (packet delays??) so the DoIO never wakes up. Maybe try CheckIO,
to see if your requests are actually being satisfied. Good Luck! SDB
SDB- Many thanks! I've now solved my problems. It was caused by there being
an improperly setu@ REPLY PORT for my iorequest! Since writing in machine
code, I had no access to the C function: CreatePort, thus I thought simply
using AddPort was enough. It wasn't. I have now got it working by using
FindTask to see what Task '*my job*' is, and then installing this value into
the reply port. — Jez.
SDB- Many thanks! I've now solved my problems. It was caused by there being
an improperly setu@ REPLY PORT for my iorequest! Since writing in machine
code, I had no access to the C function: CreatePort, thus I thought simply
using AddPort was enough. It wasn't. I have now got it working by using
FindTask to see what Task '*my job*' is, and then installing this value into
the reply port. — Jez.
Jez, Just a thought – Since DoIO waits for completion before waking up your
task, probably the definition of a "completed" task to SER: involves having
the characters removed from the buffer. Possibly they aren't being removed
quick enough (packet delays??) so the DoIO never wakes up. Maybe try CheckIO,
to see if your requests are actually being satisfied. Good Luck! SDB