deanhuff
Posts: 8
Joined: Sun Nov 08, 2020 2:48 pm

MPC23017 for DMA parallel communications?

Mon May 17, 2021 6:30 pm

I have a 23 year old MP3 player called the Diamond Rio PMP300. It has 32MB of onboard storage and can upgrade to 64MB total via an optional 32MB smart media card.

The interface to the device is a proprietary parallel cable and associated LPT adapter.

I no longer have any computers with a parallel port. Web research leads me to believe that a USB to parallel cable would not work due to kernel changes that would not allow direct memory access via the USB adapter without writing a driver.

The Debian distribution still contains the rio package which contains source code with all of the necessary API calls to interface with the device. The rio package will only access the device at memory addresses 0x278, 0x378 (default) or 0x3bc using DMA over the parallel connection.

I'm wondering if a raspberry pi would work well to perform the parallel communications. I've read that the MPC23017 chip may be a good candidate. I've also read that GPIO pins may be able to accomplish the job directly but seems that there would be more programming involved.

I am a java software developer by trade and I have no experience with I2C so this is primarily an educational exercise for me. If I am able to get things working, the community may be able to make use of my efforts.

If someone with more experience in these techniques reads this post, could you please provide feedback on my approach and offer any advise about pitfalls that I may encounter?

jayben
Posts: 304
Joined: Mon Aug 19, 2019 9:56 pm

Re: MPC23017 for DMA parallel communications?

Mon May 17, 2021 7:30 pm

Presumably the I/O lines will be at 5V signal levels, so you will need to do some level-shifting on the Pi 3.3V signals; it doesn't look as if the MCP23017 provides that functionality.

Anyway, I question whether the chip is a wise choice; driving the i2c bus fast enough might be tricky, and it'd be much easier to use (level-shifted) Pi GPIO lines directly.

I'd start by doing some simple bit-bashing of the I/O to check that communication with the MP3 player actually works, then you probably could use Pigpio, or maybe SMI if you wanted a really fast interface (see https://iosoft.blog/raspberry-pi-smi/ ).

User avatar
DougieLawson
Posts: 41440
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MPC23017 for DMA parallel communications?

Mon May 17, 2021 7:44 pm

jayben wrote:
Mon May 17, 2021 7:30 pm
Presumably the I/O lines will be at 5V signal levels, so you will need to do some level-shifting on the Pi 3.3V signals; it doesn't look as if the MCP23017 provides that functionality.
You can run an MCP23017 at 5V. No level shifting needed.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

jayben
Posts: 304
Joined: Mon Aug 19, 2019 9:56 pm

Re: MPC23017 for DMA parallel communications?

Tue May 18, 2021 8:58 am

Yes, you can power the device with 5V, but according to the data sheet, the minimum voltage to register a '1' on the i2c clock & data pins is 0.8 x Vdd, which will be 4 volts. So theoretically it shouldn't work with the 3.3V I/O on the Pi.

However, regardless of that, I still think direct-driving the I/O is an easier option.

User avatar
DougieLawson
Posts: 41440
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: MPC23017 for DMA parallel communications?

Tue May 18, 2021 9:07 pm

jayben wrote:
Tue May 18, 2021 8:58 am
Yes, you can power the device with 5V, but according to the data sheet, the minimum voltage to register a '1' on the i2c clock & data pins is 0.8 x Vdd, which will be 4 volts. So theoretically it shouldn't work with the 3.3V I/O on the Pi.
Nonsense. I've run MCP23017 at 5V with no harm to the RPi that's driving it. I2C is open drain and the RPi has external pullups on the SCL and SDA.
viewtopic.php?t=64610#p476772
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
joan
Posts: 15653
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: MPC23017 for DMA parallel communications?

Tue May 18, 2021 9:17 pm

The point is the MCP23017 needs a high of at least 0.8 times VDD to guarantee correct operation. It's okay for us hobbyists to gamble but a professional wouldn't take the risk.

deanhuff
Posts: 8
Joined: Sun Nov 08, 2020 2:48 pm

Re: MPC23017 for DMA parallel communications?

Tue May 18, 2021 11:59 pm

jayben wrote:
Tue May 18, 2021 8:58 am
However, regardless of that, I still think direct-driving the I/O is an easier option.
I will have a need to read/write several pins simultaneously to exchange data w the MP3 player, do you have an example? I had read that the mpc23017 made a task such as this easier.

User avatar
joan
Posts: 15653
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: MPC23017 for DMA parallel communications?

Wed May 19, 2021 7:46 am

If the signals are 3V3 you can simply connect each line to a GPIO. All the GPIO can be read in one operation.

E.g. for pigpio

C http://abyz.me.uk/rpi/pigpio/cif.html#g ... _Bits_0_31

Python http://abyz.me.uk/rpi/pigpio/python.html#read_bank_1

jayben
Posts: 304
Joined: Mon Aug 19, 2019 9:56 pm

Re: MPC23017 for DMA parallel communications?

Wed May 19, 2021 8:30 am

joan wrote:
Tue May 18, 2021 9:17 pm
The point is the MCP23017 needs a high of at least 0.8 times VDD to guarantee correct operation. It's okay for us hobbyists to gamble but a professional wouldn't take the risk.
Absolutely; I'm hoping that some of the hobbyists on this site will go on to work professionally in the industry, and a future employer will take a dim view of a hardware designer who plays fast-and-loose with the device specifications.

I have no problem with anyone doing anything they like with their ICs; I'm just trying to gently introduce some professional thinking into projects like this.

deanhuff
Posts: 8
Joined: Sun Nov 08, 2020 2:48 pm

Re: MPC23017 for DMA parallel communications?

Wed May 19, 2021 7:27 pm

joan wrote:
Wed May 19, 2021 7:46 am

Python http://abyz.me.uk/rpi/pigpio/python.html#read_bank_1
Thank you. I'm to the point now where I can open a mp3 file on the PI, read each byte and make 8 led's blink (one for each bit) via the GPIOs. I think that is good enough to prove out that I can send bytes down the wire.

Next up is to go learn how the parallel port channel selection worked back in the day and start sending some signals to the mp3 player to see if i can get it to send me it's header block.

Return to “Interfacing (DSI, CSI, I2C, etc.)”