Minimalist RS232 on Cyclone

Hi,

I'm new to this newsgroup, and also a relative FPGA newbie (though have lots of hardware and software experince). If I should need the FAQ, please kindly point me in the right direction.

I would like to implement a minimal RS232 interface on my Cyclone device. I only require TxD and RxD signals (I've got an RS232 level- shifter IC on board). I only require a bare-bones implementation as I need to communicate merely sufficient data to configure up to 16 8-bit registers on my Cyclone chip. Flow-control / buffer overruns should not be an issue.

It would be nice to have a terminal-like behaviour from the Cyclone (and enter commands like "R13:240" to set register 13 to value 240). A terse (and technically simpler) command structure such as "0af8[enter]" meaning: "set register 0x0a to 0xf8" would be perfectly adequate for the time being.

What is the best way to implement this function? Is there code I can download from the website?

I'm using the Quartus II software, and using a mixture of Graphical (Block) Design Files and AHDL. My present application does not require or use any Nios core.

I see downloadable UARTs on the site, but they are far more fully- functioned than I need, and apparently require licensing, which seems far too complicated and involved for a one-off project.

Thanks for any suggestion,

Andrew

SPAMTRAP: Please be sure to de-munge address if replying by email.

Reply to
Andrew Steer
Loading thread data ...

MiniUART is available from opencores. I've modified it to make even "lighter" but it should exactly satisfy your needs.

Reply to
Valentin Tihomirov

That's not really terse. You have to do the ascii/hex to binary conversions. Of course, that's just software.

If you use 8 bits with parity, you really have 9 bits. You could use the 9th bit as a command flag. You could probably do it all in hardware if that was interesting. Might be handy in the real early bringup stages. If you have fewer than 256 registers you could use a bit (in command mode) as a read/write flag and get it to send back register contents.

--
The suespammers.org mail server is located in California.  So are all my
other mailboxes.  Please do not send unsolicited bulk e-mail or unsolicited
 Click to see the full signature
Reply to
Hal Murray

You can check here

formatting link
for some simple sample code on how to make a minimal serial interface.

Reply to
Jean Nicolle

The simplest would be to use more of the ASCII table, ( which comes for free) and use something like letters 'A..T' as SetAddressPointer and 'X' and 'Y' as read/write tags, then numbers in std HEX (opposite case to the AdrPtr). That way message parsing is much simpler, and very simple state engines/storage can do the job. Syntax is a little RPN :

Rules : '0..9,a..f' : DBUf

Reply to
Jim Granville

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.