Direct Bit-Banged Serial I/O

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Direct Bit-Banged Serial I/O

Post 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.
Attachments
SoftSerial.zip
Direct serial I/O.
(3.44 KiB) Downloaded 3513 times
- Don Kinzer
spamiam
Posts: 739
Joined: 13 November 2005, 6:39 AM

Post 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
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post 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.
- Don Kinzer
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post 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.
Mike Perks
dlh
Posts: 395
Joined: 15 December 2006, 12:12 PM
Location: ~Cincinnati

Post 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.
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post 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.
- Don Kinzer
Post Reply