AVR as UART/ACIA IC
Re: AVR as UART/ACIA IC
Hi Jeff,
thanks, indeed /RES and PHI2 are labeled the wrong way, here an updated version
Peter
thanks, indeed /RES and PHI2 are labeled the wrong way, here an updated version
Peter
Re: AVR as UART/ACIA IC
I just noticed this thread, but I wanted to leave a note and hopefully follow the discussion.
I have a real need for the topic at hand here, but it does not appear any of the options thus considered will work for me.
I need a drop in replacement for the 6551 that handles faster BPS rates, has FIFOs, and supports the 6551 register set, at least as a subset of the full register set.
I have decided on combining an AVR/PIC with a CPLD. The CPLD will handle the buffers between the uC and the host system, and the AVR will handle the RS232.
I also thought of using the CPLD to massage a 8250-ish register set to match the 6551, but I have not found success there as yet. That would be the holy grail (as I'd prefer to use a stock UART instead of rolling my own in SW).
Jim
I have a real need for the topic at hand here, but it does not appear any of the options thus considered will work for me.
I need a drop in replacement for the 6551 that handles faster BPS rates, has FIFOs, and supports the 6551 register set, at least as a subset of the full register set.
I have decided on combining an AVR/PIC with a CPLD. The CPLD will handle the buffers between the uC and the host system, and the AVR will handle the RS232.
I also thought of using the CPLD to massage a 8250-ish register set to match the 6551, but I have not found success there as yet. That would be the holy grail (as I'd prefer to use a stock UART instead of rolling my own in SW).
Jim
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: AVR as UART/ACIA IC
brain wrote:
I need a drop in replacement for the 6551 that handles faster BPS rates, has FIFOs, and supports the 6551 register set, at least as a subset of the full register set.
x86? We ain't got no x86. We don't NEED no stinking x86!
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: AVR as UART/ACIA IC
Well, as for a drop-in replacement of the 6551, I can't ever see that happening. The same goes for the register set as well, unless someone opted to make something custom... and I don't see that happening either. Even trying to build up a drop-in PCB with SMT logic would be difficult as the 6551 only uses 2 address lines and most modern UARTs have at least 3 address lines.
I think most people (including myself) use the 6551 as it's like "comfort food". Once you've written the code to run it properly, it just works and is trivial to interface into any 65xx system. But if you need function and performance beyond the 6551, I would agree with BDD that the NXP line of UARTs is a much better choice going forward. Having said that, I still haven't gotten my NXP chips out of the static bags.... must be that comfort food thing.
I think most people (including myself) use the 6551 as it's like "comfort food". Once you've written the code to run it properly, it just works and is trivial to interface into any 65xx system. But if you need function and performance beyond the 6551, I would agree with BDD that the NXP line of UARTs is a much better choice going forward. Having said that, I still haven't gotten my NXP chips out of the static bags.... must be that comfort food thing.
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: AVR as UART/ACIA IC
floobydust wrote:
Having said that, I still haven't gotten my NXP chips out of the static bags...
x86? We ain't got no x86. We don't NEED no stinking x86!
- floobydust
- Posts: 1394
- Joined: 05 Mar 2013
Re: AVR as UART/ACIA IC
BigDumbDinosaur wrote:
floobydust wrote:
Having said that, I still haven't gotten my NXP chips out of the static bags...
Still, I really want to finish up the little perfboard I started on almost 2 years ago. It has a NXP SCC2691, a 74HC00 and a MAX232 chip along with a crystal and some caps. This will plug into my I/O board in place of a 6522 and give me a second serial port to start coding for. I just need to solder in the sockets, wire it up and start coding. My current C02BIOS has proven to be rock solid at least which supports a 65C51 and 65C22, so the comfort factor still reigns, who knew.
Regards, KM
https://github.com/floobydust
https://github.com/floobydust
Re: AVR as UART/ACIA IC
BigDumbDinosaur wrote:
brain wrote:
I need a drop in replacement for the 6551 that handles faster BPS rates, has FIFOs, and supports the 6551 register set, at least as a subset of the full register set.
I understand the desire to use a better UART, but most people don't want to buy a device that is not compatible with existing SW, and newer SW developers don't want to develop for a device that no one owns.
Jim
Re: AVR as UART/ACIA IC
floobydust wrote:
Well, as for a drop-in replacement of the 6551, I can't ever see that happening. The same goes for the register set as well, unless someone opted to make something custom... and I don't see that happening either. Even trying to build up a drop-in PCB with SMT logic would be difficult as the 6551 only uses 2 address lines and most modern UARTs have at least 3 address lines.
It uses a CPLD to redefine one of the registers (the bps rate reg)It extends the baud rate selection bits by 1 bit, using up the RXC bit and turning it into another 16 bps rate selections. I use 3 of them for the additional bps rates, storing them in the CPLD but sending 'b10000 to the 6551 so it uses the /16 bps rate setting. I then use the internally stored bits to set the divisor of the counter that feeds the XTAL pin on the 6551 to set the correct rate.
I also use bps rate 'b00000 to "lock" the bps rate if you want to set a faster rate and then use an older program. Setting the correct bps rate and then "locking" it will prevent any attempts to write to the register until unlocked or hard reset.
The above requires a 6551A as a minimum to be plugged into it, but can fit it in any 6551 socket.
Still no FIFOs and such, but it's a start.
Jim
Re: AVR as UART/ACIA IC
brain wrote:
storing them in the CPLD but sending 'b10000 to the 6551
Quote:
I also use bps rate 'b00000 to "lock" the bps rate if you want to set a faster rate and then use an older program.
cheers
Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: AVR as UART/ACIA IC
So, I have this idea working, and will be exhibiting it soon.
I am not sold on the 'b00000 lock idea, and so wanted to ask for suggestions. My concern with 'b00000 locking is: How do you unlock?
I also considered a "port knocking" approach using the status register:
lda #$55
sta status_reg
lda #$aa
sta status_reg
lda #$01
sta status_reg
lda #$00 ;-> lock after next store
sta status_reg
lda #<acia control>
sta cmd_reg ; <- and now locked.
lda #$55
sta status_reg
lda #$aa
sta status_reg
lda #$01
sta status_reg
lda #$01 ; unlocked.
I am not sold on the 'b00000 lock idea, and so wanted to ask for suggestions. My concern with 'b00000 locking is: How do you unlock?
I also considered a "port knocking" approach using the status register:
lda #$55
sta status_reg
lda #$aa
sta status_reg
lda #$01
sta status_reg
lda #$00 ;-> lock after next store
sta status_reg
lda #<acia control>
sta cmd_reg ; <- and now locked.
lda #$55
sta status_reg
lda #$aa
sta status_reg
lda #$01
sta status_reg
lda #$01 ; unlocked.
Re: AVR as UART/ACIA IC
brain wrote:
My concern with 'b00000 locking is: How do you unlock?
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: AVR as UART/ACIA IC
Dr Jefyll wrote:
brain wrote:
My concern with 'b00000 locking is: How do you unlock?
lda #0
sta cmd_reg
lda #<real bps rate>
sta cmd_reg
And thus the lock is undone and the incorrect rate is stored.
I could fix by using 01111 as the value, though.
The only challenge is that it is tougher to know when the IC is locked.
Jim
Re: AVR as UART/ACIA IC
Instead of enhancing the 6551 externally with a CPLD I suggest that you integrate the logic of the 6551 into the CPLD. Then you can extend it with all type of registers outside the normal ACIA.
Re: AVR as UART/ACIA IC
cbscpe wrote:
Instead of enhancing the 6551 externally with a CPLD I suggest that you integrate the logic of the 6551 into the CPLD. Then you can extend it with all type of registers outside the normal ACIA.
Jim
Re: AVR as UART/ACIA IC
At mouser the small CPLD ATF1504 and a W65C51 cost together about 12 swiss franks and the larger CPLD ATF1508 costs 8 swiss frank. I know that the receiver and the transmitter with buffering fits in a ATF1508 (i have done this and the design requires about 70 flipflops). Whether all the other features still fit in the ATF1508 I need to check. But if you can live without modem control signals (and honestly who does need them nowadays) it should not be a problem and as the ACIA only requires very few pins you can use the rest of the pins to build your address decoder. a address decoder typically requires alot of pins but very little CPLD resources. In other words they complement each other perfectly.