Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Wait time between characters when sending serially
Author | Message | ||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Hi, is there a way to force a wait time between characters when sending via serial port? Like it is possible with TeraTerm (Transmit delay msec/char)? Thanks! Frank |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
The only way I can think of to do that would be to send character by character rather than send a string. There's no setting that I know of to do it. If you need a low baud rate (less than 1200) it might be better to bitbang the output rather than use the COM system. It may tie up your program during transmit though. I suppose you could use SETTICK to send characters at set intervals that way. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Hi Mick, that's a good idea. I am afraid that there will be no other possibility - what a pity! I want to communicate with my HX-20 and he needs a breather between characters... Frank |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6100 |
Try setting the serial to two stop bits. That often is enough. Jim VK7JH MMedit MMBasic Help |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3804 |
If that's not slow enough I suppose you send 1 char, wait for it to go, pause & repeat. You've done worse, I expect! John |
||||
aFox Regular Member Joined: 28/02/2023 Location: GermanyPosts: 76 |
Hi I found this datenaustausch-mit-dem-epson-hx-20-unter-windows and this datenuebertragung-vom-pc-zum-epson-hx-20 Sorry only in German, but Google Translate is your friend. Gregor |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Yes, and on this basis I would like to build a device to communicate between HX-20 and PicoMite... Frank |
||||
NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 200 |
Wow - a flash from the past! I implemented an electric meter reading application on the HX-20 in Basic in about 1984, and then found a company that wrote callable Hitachi 6301 assembly language code for it to dramatically speed up microcassette tape I/O (almost identical to CSUBs in MMBasic). Sold as a commercial meter reader to electric utilities. Epson HX-20 Wikipedia I really liked the Z-80-based successor to the HX-20 (the Epson PX-8), for which I configured the CP/M program "VEDIT" (a superb text editor from Greenview Data in Ann Arbor, Michigan). Solid as a rock... Epxon PX-8 Wikipedia Edited 2023-06-29 08:38 by NPHighview Live in the Future. It's Just Starting Now! |
||||
Grogster Admin Group Joined: 31/12/2012 Location: New ZealandPosts: 9308 |
Use the BITBANG SERIALTX routines. When I ported some PICAXE code to MMBASIC, the buffered COM ports played havoc with the PICAXE based receiver unit. The way to fix it was to add 2ms of delay between the data-slicer sync bytes and the payload. SUB TRANSMIT (DTA$) 'MUST send the message this way, to make it work with the PICAXE data filter. LOCAL T$ T$="UUUUUUUUUUUUUUU" 'Preamble bytes(10101010) to sync the data-slicer in the receiver PIN(EN)=1 'Enable NTX2 transmitter PAUSE 15 'Allow NTX transmitter to power-up FOR X=1 TO LEN(T$) BITBANG SERIALTX TXD,2400,MID$(T$,X,1) 'Send message one byte at a time. Introduces small delay between bytes for the PICAXE decoder. PAUSE 1 'Needed to help the PICAXE 08M2 decoder - DO NOT REMOVE!!! NEXT X PAUSE 2 'Separation delay between sync bytes and actual packet - DO NOT REMOVE!!! FOR X=1 TO LEN(DTA$) BITBANG SERIALTX TXD,2400,MID$(DTA$,X,1) 'Send message one byte at a time. Introduces small delay between bytes for the PICAXE decoder. PAUSE 1 'Needed to help the PICAXE 08M2 decoder - DO NOT REMOVE!!! NEXT X PAUSE 25 PIN(EN)=0 'Disable NTX2 module END SUB The beauty of SERIALTX and SERIALRX is that they are blocking, which CAN be a very much desired thing, such as in my case, where using the buffered COM port squirts the packet out with no delays, and aligns all the data bytes right beside each other and the PICAXE receiver TOTALLY ignores it. The routine above may not be that elegant, but it works, and it works 100% of the time, and that is the most important bit. Smoke makes things work. When the smoke gets out, it stops! |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Hi Grogster, thank you very much, this looks very good!!! Frank |
||||
Print this page |