6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Apr 29, 2024 1:08 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 12:30 am 
Offline

Joined: Wed Nov 03, 2021 6:52 pm
Posts: 8
Hello all! I've just started working on adding an R6551 to my 65c02 computer. I have read over some of Garth's RS-232 primer guide and just had a quick question - is it possible to use an Arduino as a RS-232 transmitter to an R6551 receiver without a line driver/receiver, like the MAX232? Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 2:17 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Well, I guess my first question is:

What do you plan on using the 6551 for? Is it as a console or just an I/O device to communicate with another machine? Second question: what is your preferred method of connecting the 6551 to another device (or machine)?

Last I checked, I don't think an Arduino has a +/- 12-volt supply or I/O pins that would be able to provide the RS-232 voltage levels, as you mentioned using it in place of a MAX-232 level converter.

If you want to attach it as a serial device to a typical computer, there are numerous USB to Serial interfaces available from FTDI and other vendors. As most newer machines do not have serial ports (aka RS-232 ports), these interface devices will give you a serial port via a USB port. This can allow direct TTL level attachment between the 6551 and the USB to serial interface.

Not sure if this helps, but perhaps you can be more specific in what you're trying to accomplish.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 12:51 pm 
Offline

Joined: Wed Nov 03, 2021 6:52 pm
Posts: 8
To start with, I just wanted to get it working - that is, load data into RAM from an Arduino. I was thinking since the 6551 chip is TTL, the Arduino could send bits to the RxD pin directly. I don't really understand how the 6551 chip works, to be honest. Reading over the 6551 datasheets doesn't seem to click with me, for some reason.

It sounds like using the USB to Serial might be a similar situation, then? Using TTL level voltage to send bits?

Thanks for the assistance!


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 6:15 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
Okay, I agree that you're not quite aware of how the 6551 works... no problem. In short, the 6551 is a serial controller, meaning it allows serial communication at various baud rates with the usual RS-232 signals. Before it will operate, it needs to be configured for things like baud rate, number of data bits, parity, stop bits, etc. Unless you configure it first, it doesn't do anything.

As you're looking to use an Arduino to load some level of initial code into RAM (others have done this), you would need to halt the processor and tristate the address and data lines (from the processor), which would allow the Arduino to control the address lines and push data into memory. Once that's done, you un-tristate the address and data lines and then let the processor come out of Reset.

Note that the 65C02 datasheet is your friend... control lines like Reset, RDY, BE are specific ones to read up on. As for the Arduino, I'm guessing you're already familiar with that, so you can likely put something together to interface to the 6502 system.

Do some searching on the forum.... you'll find that others are loading RAM from other machines... Gordon (Drogon on the forum) comes to mind with his Ruby systems.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 6:35 pm 
Offline

Joined: Wed Nov 03, 2021 6:52 pm
Posts: 8
Sorry! I know I'm not being very clear on what I am asking for; that's my fault. I did read over the 6551 datasheet and added some code to initialize it, setting up the command and control registers for parity, baud rate, echo, and all that. I made sure to read back the registers to make sure my hardware address decoding works and it does. I have previously used an Arduino connected to a 65c22 to bit-bang data into RAM after pressing a physical button and that works (more or less). It loads all the data into RAM and then jumps to the data's entry point.

I want to now add the RS-232 style of adding bytes into RAM, similarly by pushing a button (for now and for testing). I know the RS-232 standard uses ~12 volts and uses a line driver/receiver to drop it down to 5 volts. I think that is correct? Maybe my understanding is flawed?


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 7:03 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1373
So you have some ROM (EPROM/EEPROM) in the system already? How about posting a schematic and what it is you're doing code-wize.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 8:31 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
ty9000, I have not gotten into Arduino, but I suspect it does not have the RS-232 line drivers and receivers, but instead just uses TTL signal levels, making it less bulletproof but perhaps more convenient. This has become quite common in recent years, particularly as most PCs don't have RS-232 ports anymore. The '51 itself just operates with the TTL levels too. It doesn't know or care if you're using line drivers or receivers. If that's what the Arduino also does, you should be able to hook them up straight across. The FTDI converters which floobydust mentions come in different versions, with and without line drivers and receivers. Just make sure you get the right one.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: R6551 & Arduino
PostPosted: Thu Nov 18, 2021 9:09 pm 
Offline

Joined: Wed Nov 03, 2021 6:52 pm
Posts: 8
GARTHWILSON wrote:
ty9000, I have not gotten into Arduino, but I suspect it does not have the RS-232 line drivers and receivers...


No, I don't think Arduinos have line drivers/receivers - some of the larger ones have multiple Serial interface ports (Tx and Rx) where the baud rate can be defined, whereas smaller ones need to have a second Serial interface created via software (not the most optimal solution). But yes - I'm pretty sure it's just a digital 5v or 0v signal at any point in time.

GARTHWILSON wrote:
If that's what the Arduino also does, you should be able to hook them up straight across. The FTDI converters which floobydust mentions come in different versions, with and without line drivers and receivers. Just make sure you get the right one.


Okay, that's what I thought since the Arduino can send +5v or 0v from its digital pins. I figured if I went this explicit route, I would technically never be able to hook it up to a "real" computer via RS-232 cable since I don't have the line driver/receiver. I did find many USB/UART devices online that have a FT232RL chip in them, so I might go that route too. It may be easier in the long run since I can just use a PuTTY or something akin to that and it'll just natively "work."


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: