Jump to content
IGNORED

Anyone tried hooking up a modern "microcontroller" to an Atari?


Recommended Posts

I've always had a bit of an interest in electronics but, apart from one attempt many years ago, have never really got into it in a big way. Last couple of weeks I've been looking at the modern "microcontrollers". I put that in quotations because they're not really microcontrollers in the true sense of the word. They're tiny SBCs. The price of some have shot through the roof, as well as the full blown Raspberry Pi. I have a Pi 3 (I think) that I want to try interfacing with the 800XL but the MCU that arrived a couple of days ago was the ESP32. This looks like a neat little unit on a par with the Pi Pico.

 

I'm going to have a little play around with hooking it up to the PBI on the XL and see what i can do with it. Is there anything in particular I need to be careful of? I know the PBI is 5v output and I'll need to reduce that to 3.3V for the GPIO pins on the ESP32. The PBI, though, can handle 3.3V input because TTL logic high is 2V - 5V?

  • Like 2
Link to comment
Share on other sites

Hooking up a micro controller is a great idea.  You would open up possibilities of having a lot of easily programmable options.  For example, having an SD card act like a hard disk is just one of them.  Other options would include adding a USB keyboard.  But, you can do practically anything with the Atari PBI.

 

Your 800XL probably doesn't have +5vdc to the PBI unless you connect +5vdc to pins 47 and 48.

 

I've made up a guide on the PBI as there is a lot of conflicting or wrong information out there.  Here's the latest public draft copy:

 

Parallel Port Guide v0_91.pdf

 

Edit:

 

Level shifting would be an unfortunate necessity, as you already figure.  Here's some info on voltage levels:

 

https://www.allaboutcircuits.com/textbook/digital/chpt-3/logic-signal-voltage-levels/

 

Personally, I'd make it a 1090 card.  That way multiple devices can be connected to the parallel port. 

 

Here's a link to the 1090XL remake link:

 

 

 

 

 

Edited by reifsnyderb
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

It looks like microcontroller access to the PBI has been done before, for example with the UnoCart:

 

https://github.com/robinhedwards/UnoCart

 

There have been a couple threads on Atari Age over the years discussing it-- and the difficulty of accessing the bus between 6502 clock cycles (aka "racing the bus"):

 

 

 

Link to comment
Share on other sites

6 minutes ago, malachykidd said:

It looks like microcontroller access to the PBI has been done before, for example with the UnoCart:

 

There have been a couple threads on Atari Age over the years discussing it-- and the difficulty of accessing the bus between 6502 clock cycles (aka "racing the bus"):

 

You don't necessarily have to "race the bus".  Instead, you could setup handshaking, through the use of registers, so that "racing the bus" is no longer an issue.

 

 

  • Like 1
Link to comment
Share on other sites

I used a Arduino UNO some time ago to interface a USB joypad to my 8 bits, later modified the software

to attach a USB keyboard using just joystick 1 port only, obviously not full functionality (START/SELECT/OPTION)

but everything else.

Used a UNO as it's 5V input/output so no level shifters needed.

  • Like 1
Link to comment
Share on other sites

10 hours ago, TGB1718 said:

I used a Arduino UNO some time ago to interface a USB joypad to my 8 bits, later modified the software

to attach a USB keyboard using just joystick 1 port only, obviously not full functionality (START/SELECT/OPTION)

but everything else.

Used a UNO as it's 5V input/output so no level shifters needed.

I do have a Uno but I bought it for the still as yet incomplete SDrive-MAX I started putting together a little while ago. Might have a go at finishing it this weekend.

But I like the idea of having a tiny board do everything and then just build stuff up around it.

 

1 hour ago, Nolium said:

What about this: https://github.com/LessNick/Astarta-ESP32

 

What about RPi? Like this mod on C64: https://github.com/frntc/Sidekick64

 

Availability of Pi3A+ is getting better, for about 30ish EUR. Neat RPi stock locator with RSS feed: https://rpilocator.com/

 

Yeah, I have a Model 3, I think. Been looking at the possibility of hooking that one up because I have a quite insane project idea for it. 😂

The ESP32 will allow me to get a bit more experience on the cheap without blowing a hole in something on the Pi.

 

19 hours ago, malachykidd said:

It looks like microcontroller access to the PBI has been done before, for example with the UnoCart:

 

https://github.com/robinhedwards/UnoCart

 

There have been a couple threads on Atari Age over the years discussing it-- and the difficulty of accessing the bus between 6502 clock cycles (aka "racing the bus"):

 

There is a guy called Gary Simms who has a nice YouTube channel simply called Gary Explains and he shows how to hook up a 6502 directly to a Pico in one video and uses the Pico as a memory emulator. Didn't look like it needed anything special. But I'm wondering if the same principles can be attached to the PBI considering that anything attached to it has to share the address and data buses with several other chips.

Link to comment
Share on other sites

Just been reading the PBI pdf. Trying to get my head around how the address and data lines work. Am I right in thinking that the Atari can read/write data from and to devices attached to the PBI but devices attached to the PBI can't read/write data on the Atari's own system memory? In order to do that, the PBI device would need its own memory mapped to the RAM area that you would like to access?

Oh - and how on earth does 80 column video work on a system designed to run on 40 columns. I remember doing a type-in listing that offered 80 columns but that was done by messing around with the character set and squishing them a little. To do it properly, surely you'd need to double the pixel resolution?

Edited by Tickled_Pink
Link to comment
Share on other sites

1 hour ago, Tickled_Pink said:

Just been reading the PBI pdf. Trying to get my head around how the address and data lines work. Am I right in thinking that the Atari can read/write data from and to devices attached to the PBI but devices attached to the PBI can't read/write data on the Atari's own system memory? In order to do that, the PBI device would need its own memory mapped to the RAM area that you would like to access?

 

 

The address and data lines are controlled by the CPU and ANTIC.  It's possible to have memory shared between the Atari and the PBI device but you need to have buffers, on the shared memory, that can separate the memory from the Atari's bus.

 

1 hour ago, Tickled_Pink said:

Oh - and how on earth does 80 column video work on a system designed to run on 40 columns. I remember doing a type-in listing that offered 80 columns but that was done by messing around with the character set and squishing them a little. To do it properly, surely you'd need to double the pixel resolution?

There are two main 80 column solutions:  Hardware and software.  The 1090 80 column card is a hardware solution.  It has it's own character set and ROM.  The Atari writes to PBI addresses, in the $D1xx range as documented in the PBI document, in order to tell the card what to display.  The monitor needs to be connected to the 80 column card instead of the Atari.

 

With the 80 column listing, you referred to, the Atari would be using graphics mode 8 to display characters that are 3 pixels wide.

 

 

Edited by reifsnyderb
Link to comment
Share on other sites

@Tickled_Pink:  Admittedly, the Atari PBI system is pretty complicated.  I'll probably add a flowchart to my PBI document at some point. 

 

While there are a lot of specifics, if you are making a PBI card, the OS does the following:

 

1.  Scans $D1FF and checks a couple bytes in the $D8xx region.

2.  If those 2 bytes match, the OS assumes a device is present and runs the initialization code in the $D8xx region.

3.  If you are doing more than just running some code, you'll need all the driver goodies setup.  i.e.  HATABS stuff.

4.  The initialization code will have to install the drivers and set a bit so the OS knows which device is the card.

 

If you'd like to make it a 1090 card, I'd be happy to give you some information as to how to get those cards to work, too.  (The 1090 is awesome.   🙂   )

 

What are you thinking of doing with the micro controller?

Edited by reifsnyderb
Link to comment
Share on other sites

16 minutes ago, reifsnyderb said:

@Tickled_Pink:  Admittedly, the Atari PBI system is pretty complicated.  I'll probably add a flowchart to my PBI document at some point. 

 

While there are a lot of specifics, if you are making a PBI card, the OS does the following:

 

1.  Scans $D1FF and checks a couple bytes in the $D8xx region.

2.  If those 2 bytes match, the OS assumes a device is present and runs the initialization code in the $D8xx region.

3.  If you are doing more than just running some code, you'll need all the driver goodies setup.  i.e.  HATABS stuff.

4.  The initialization code will have to install the drivers and set a bit so the OS knows which device is the card.

 

If you'd like to make it a 1090 card, I'd be happy to give you some information as to how to get those cards to work, too.  (The 1090 is awesome.   🙂   )

 

What are you thinking of doing with the micro controller?

Not entirely sure at the minute. So many possibilities. RAM expansion, of course (although that's been done to death, so it would be a learning project), or programmable multi controller ports, some kind of I/O controller. The idea I have for the Raspberry Pi probably won't work for all cases with what I have in mind but the architecture of the Atari may allow it to be used as HDMI output. Obviously won't be able to use the full Pi on a final project, but the Pi Zero or Pi Zero look-a-likes with HDMI output could do the job. But, like I say, it would probably work best with older software where devs haven't tried anything too fancy.

Yeah, I'd like to come up with something for the 1090 but let's just learn to walk before I try to run, eh? 😉

Link to comment
Share on other sites

37 minutes ago, Tickled_Pink said:

Not entirely sure at the minute. So many possibilities. RAM expansion, of course (although that's been done to death, so it would be a learning project), or programmable multi controller ports, some kind of I/O controller. The idea I have for the Raspberry Pi probably won't work for all cases with what I have in mind but the architecture of the Atari may allow it to be used as HDMI output. Obviously won't be able to use the full Pi on a final project, but the Pi Zero or Pi Zero look-a-likes with HDMI output could do the job. But, like I say, it would probably work best with older software where devs haven't tried anything too fancy.

Yeah, I'd like to come up with something for the 1090 but let's just learn to walk before I try to run, eh? 😉

A RAM expansion would require racing the bus.  If it can be done, that would be interesting.  My post from 9/2/2022, on the 1090XL thread, has a schematic that shows how a 1090 RAM expansion is done using 74x "glue" logic.

 

It wouldn't be hard to extend my 1090 firmware board so that it makes registers available for communications between a micro controller and the Atari.  I'd literally just have to install buffers, level shifters, registers, and an enable line.  While I am currently using the firmware board for some other project, most of the logic is already in place.

 

Something else to keep in mind is the cost of the boards.  Keeping the board to under 100mm on a side keeps the cost down.  If you exceed 100mm, there is an additional "engineering fee" added.  (It was $7 for a 2 layer board and $35 if using a 4 layer board.)  Keep away from 4 layer boards, if possible.  They take more time and command quite a premium if they are bigger than 100mm on a side.

Link to comment
Share on other sites

39 minutes ago, Tickled_Pink said:

Just found this. hardware - How to implement bus sharing / DMA on a 6502 system - Retrocomputing Stack Exchange

 

So, if I wanted to access memory shared by another component, such as the CPU or ANTIC, I'd have to halt them first, presumably to avoid some kind of bus contention?

You don't have the capability to issue a /HALT signal from the PBI.  In the Atari, ANTIC is mostly in charge as it issues the /HALT signal to suspend the CPU so it can take over the bus.

Link to comment
Share on other sites

On 3/2/2023 at 5:24 PM, Tickled_Pink said:

I have a Pi 3 (I think) that I want to try interfacing with the 800XL but the MCU that arrived a couple of days ago was the ESP32. This looks like a neat little unit on a par with the Pi Pico.

Check out the FujiNet.  It uses the ESP32 for interfacing with SIO as well as emulating SIO devices.

Link to comment
Share on other sites

8 hours ago, reifsnyderb said:

You don't have the capability to issue a /HALT signal from the PBI.  In the Atari, ANTIC is mostly in charge as it issues the /HALT signal to suspend the CPU so it can take over the bus.

So, how would something like the Black Box work? IIRC that didn't have RAM onboard. But I'm guessing that one of the chips had some RAM which was mapped to an area of system RAM?

Link to comment
Share on other sites

5 hours ago, Tickled_Pink said:

So, how would something like the Black Box work? IIRC that didn't have RAM onboard. But I'm guessing that one of the chips had some RAM which was mapped to an area of system RAM?

There is a section of memory from $D600-$D7FF that Atari reserved for the PBI.  (Atari also had that section of memory sectioned out for different devices but I don't think they ever had a card that took advantage of this.)  Black Box works with $D600-$D6FF.  VBXE also uses memory in the region from $D600-$D7FF.  (It looks like it's configurable.) 

 

The Black Box schematic is here:  https://forums.atariage.com/topic/331987-looking-for-the-black-box-schematic/

 

 

A quick look through the Black Box schematic does not indicate the memory is shared between the 6502 and anything else.  So there wouldn't be a problem.  Maybe I am missing something, though.  The schematic is rather odd.

 

The 1090 80 column card schematic may be more helpful as the 6502 and MC6845 have memory that is partially accessible by both.  The schematic is here:  https://github.com/kenames99/80cvc

 

 

 

 

Link to comment
Share on other sites

Hello guys

 

IIRC the Blackbox didn't share the bus and neither did the MIO.  The MIO is older than the Blackbox.  The MIO did have memory that could/can be used as a memory extension or (partly???) as a printer spooler.  The BlackBox in its basic form had IIRC 8 kB of RAM, which could/can be extended to 64kB.  If extended to 64kB the RAM can be used as a printer spooler, but not as a memory extension.  Bob Puff once told me a memory extension could be added to the BlackBox just like the FloppyBoard is added to it.

 

Maybe @guus.assmann or @Fox-1 / mnx can shed some light on how to make the BlackBox share the bus.  It seems to be very easy and the hardware needed would be cheap.  Bob Puff also told me this should be possible, if the software for the BlackBox only used the lowest (4 or 5, depending on which version of the BlackBox you have) bits at the address where the PBI IDs are.  (Was that $D1FF ?)

 

Sincerely

 

Mathy

 

 

Link to comment
Share on other sites

8 minutes ago, Mathy said:

Hello guys

 

IIRC the Blackbox didn't share the bus and neither did the MIO.  The MIO is older than the Blackbox.  The MIO did have memory that could/can be used as a memory extension or (partly???) as a printer spooler.  The BlackBox in its basic form had IIRC 8 kB of RAM, which could/can be extended to 64kB.  If extended to 64kB the RAM can be used as a printer spooler, but not as a memory extension.  Bob Puff once told me a memory extension could be added to the BlackBox just like the FloppyBoard is added to it.

 

Maybe @guus.assmann or @Fox-1 / mnx can shed some light on how to make the BlackBox share the bus.  It seems to be very easy and the hardware needed would be cheap.  Bob Puff also told me this should be possible, if the software for the BlackBox only used the lowest (4 or 5, depending on which version of the BlackBox you have) bits at the address where the PBI IDs are.  (Was that $D1FF ?)

 

Sincerely

 

Mathy

 

 

A PBI print spooler would be awesome!  It shouldn't be too hard to do, either.

  • Like 1
Link to comment
Share on other sites

Hello Brian

 

10 minutes ago, reifsnyderb said:

A PBI print spooler would be awesome!  It shouldn't be too hard to do, either.

 

 

A PBI memory expansion (a big one, that doesn't use $D301) would be awesome, especially if (part of it) can also be used as a printer spooler.

 

Sincerely

 

Mathy

 

 

 

Link to comment
Share on other sites

8 hours ago, _The Doctor__ said:

Remember the Black Box did share the PBI, and would need fixes to do so, The MIO might be more PBI compliant

as you can read while the first part of my post is missing the word NOT, the continuation  ...    and would need fixes to do so ... indicates that it did not. I couldn't fix it and type NOT as in did not. I will make a request to fix it again.

I really wish the forum would let sh*t get corrected for a longer duration, but that's only for paying members or admin/moderator requests to alter a post, when it's seen or gotten to.

Edited by _The Doctor__
Link to comment
Share on other sites

2 hours ago, Mathy said:

Hello Brian

 

A PBI memory expansion (a big one, that doesn't use $D301) would be awesome, especially if (part of it) can also be used as a printer spooler.

 

Sincerely

 

Mathy

A printer spooler would be a rather dedicated card.  The big question has to do with how to access the spooler memory.

Using anything from $D600-$D7FF is probably out because of either VBXE or, possibly, a U1MB. 

Banking it in, via a special bank at $4000-$7FFF, is a possibility as you could access 16k regions at a time.  That would probably have to be done during VBLANK.  I suspect there would be some other problems, though.

While officially for ROM, banking RAM in the $D800-$DFFF range would also be a possibility.  Maybe 1k banks between $DC00 and $DFFF would be the safest.  Use $D100 for the banking register for the printer spooler.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...