Page 1 of 1
Direct Bit-Banged Serial I/O
Posted: 04 May 2009, 15:54 PM
by dkinzer
A customer needed a way to perform serial I/O to multiple devices at fairly high speed; higher than the 19.2K supported by the ZBasic software UARTs (Com3-Com6). They suggested that something similar to the SERIN and SEROUT commands of PBasic would meet their requirements quite nicely. In response, I put together some code (for native mode only) that performs direct (non-buffered) serial I/O that has been tested as high as 115.2K baud. It should be able to go even higher, perhaps as high as 460.8K baud.
You can find the code attached. Some discussion of the advantages/disadvantages and a simple test driver can be found in the source code.
Posted: 05 May 2009, 11:14 AM
by spamiam
Don,
When I tried to D/L the zip file, I got an error saying that the zip file was invalid or corrupt!
-Tony
Posted: 05 May 2009, 11:19 AM
by dkinzer
spamiam wrote:When I tried to D/L the zip file, I got an error saying that the zip file was invalid or corrupt!
I just tried it and it seemed fine, both when opening it directly and when saving it first and then opening.
I can send it to you by email if you'd like.
Posted: 05 May 2009, 11:39 AM
by mikep
spamiam wrote:When I tried to D/L the zip file, I got an error saying that the zip file was invalid or corrupt!
Worked for me.
Posted: 01 June 2009, 17:09 PM
by dlh
Any chance of a version that could be used for downloading?
I have a handful of applications where the ZX-328n would be ideal but the need to invert the hardware UART adds cost and takes up too much PCB real estate.
Posted: 01 June 2009, 17:46 PM
by dkinzer
dlh wrote:Any chance of a version that could be used for downloading?
Unlikely. The downloading code is in the "bootloader" portion of the device that is programmed during manufacturing. Although it might be possible, conceptually, to include bit-banged serial in the bootloader, there isn't enough space left in the bootloader section of Flash to include it.