CompuServe Thread

Forum unknown · SoftwareDevelopment

Serial.Device (HELP!!)

7 messages in this thread
#4577From: Jez San @ Argonaut S/WJan 8, 1986 1:52 AM
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.
#4680From: TIM JENISONJan 9, 1986 12:29 AM
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.
#4680From: TIM JENISONJan 9, 1986 12:29 AM
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.
#4694From: Scott BallantyneJan 9, 1986 2:35 AM
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
#4706From: Jez San @ Argonaut S/WJan 9, 1986 3:28 AM
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.
#4706From: Jez San @ Argonaut S/WJan 9, 1986 3:28 AM
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.
#4694From: Scott BallantyneJan 9, 1986 2:35 AM
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