Shop OBEX P1 Docs P2 Docs Learn Events
Reading ROM chip with QuickStart — Parallax Forums

Reading ROM chip with QuickStart

justjoeyjustjoey Posts: 5
edited 2017-02-08 13:23 in Propeller 1
I recently bought a QuickStart board. I'm following along with this wonderful post on how you can read a ROM chip with an arduino (https://www.nycresistor.com/2012/07/07/stick-a-straw-in-its-brain-and-suck-how-to-read-a-rom/)

I connected my chip (TS27C64A) with all of the pins on the right side into the even-numbered pins on the Prop. And all of the pins on the left side of my chip into the odd-numbered pins of my Prop. Now, I just need to figure out how to translate the arduino code(https://github.com/phooky/PROM/blob/master/tools/eeprom_read/eeprom_read.pde) into C code for my propeller. I was wondering if anyone could help me?

Comments

  • Admin: Moved to Propeller 1 forum.
  • kwinnkwinn Posts: 8,697
    The procedure is pretty straight forward. The address is output on as many pins as needed (13 pins for 8Kx8) and data is input from 8 other pins. Much simpler if the address pins and data pins are consecutive. IIRC, when I wired up a circuit to read eproms the address was on pins P0 - P15 and the data on P20-P27. P16-P19 were used for things like /CS and /OE. This was for reading all the chips on a board. For individual eproms it is somewhat simpler as fewer address bits and control signals are needed.

  • More than likely the EPROM is 5V logic and the Prop is 3.3V unlike the Arduino. You will need current limit resistors from the data pins but it may be that the 3.3V signals from the Prop for the address and CE/OE need to be translated to 5V so you will need some buffer logic such as the 74HCT series in there. So this is not going to be as simple as connecting it straight up to the Prop. Otherwise the software is really a no-brainer but if you don't connect address and data pins up in ascending order to I/O pins in ascending order then you will have a tougher job of scrambling and unscrambling those lines in software. For instance - D0..D7-->P0..P7, A0..A12 --> P8..P20 etc will make the software very simple.
  • kwinnkwinn Posts: 8,697
    Good point about the 3.3V to 5V translation, but if that is required it is probably better to use a couple of 74HCT4040 binary counters for the address lines. That gives you 24 bits of address using only two Propeller pins, which is more than enough to handle virtually all the parallel eproms/eeproms out there.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    Though it would be a bit slower, this could have also been done using just four (4) I/O pins using two (2) 74HC595 shift registers and one (1) 74HC165 shift register. 24 I/O pins would certainly be the fastest route, but depending on what else you're doing with the data you might opt to conserve pins.

    You would have a 16-bit address variable which would be shifted out to the 74HC595s while the resulting data byte was read in from the 74HC165.
  • kwinnkwinn Posts: 8,697
    edited 2017-02-09 00:46
    Definitely the lowest pin count, and that could even be reduced to 3 pins. OTOH it requires the most external hardware and most complex software although the hardware and software requirement is not all that much.
  • If you are going to go serial then make them all PCF8574 I2C expanders or similar on the EEPROM bus and then it doesn't take up any extra lines. But why stop there, if you add a VPP and VCC switch you could also program the device just as easily. Now, to find that Z80 board to plug the EPROM into...

    The 5V that Arduinos operate on is a real throwback which means it can interface with all the old 80's and 90's tech like 5V EPROMs directly, not that I could see any real use for that but they must have a terrible time interfacing to modern 3.3V devices.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    I guess I'm just opposed to using so many address lines off the MCU for simple functions such as input/output. In the case of the address lines, those only ever need to be outputs.
  • kwinnkwinn Posts: 8,697
    I guess I'm just opposed to using so many address lines off the MCU for simple functions such as input/output. In the case of the address lines, those only ever need to be outputs.

    Understandable, and I also tend to conserve pins, cogs, and memory when I design something. OTOH if the board is to be dedicated to one task or is an interface that plugs in to the 40 pin quickstart/project board connector it makes sense to use as many pins as required to minimize external hardware.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    kwinn wrote: »
    Understandable, and I also tend to conserve pins, cogs, and memory when I design something. OTOH if the board is to be dedicated to one task or is an interface that plugs in to the 40 pin quickstart/project board connector it makes sense to use as many pins as required to minimize external hardware.

    That is true...I recently worked with a guy who designed a piece of hardware to do something (can't be more specific). And I questions why he set things up the way he did. He didn't really have an answer, but later wanted to expand his idea and had he thought ahead a bit he'd have been able to do that easily.

  • Or you could get a Propeller ASC (Arduino Shield Compatible) board, which maps the Propeller I/O pins to an Arduino compatible set of headers and just run the Arduino sketch.
  • I think the appeal for this project was not the conservation of I/O pins but the fact that you could interface an old EPROM directly to the MCU, and almost physically by piggybacking in the case of the Arduino. Alas, the Prop is 3.3V and old EPROMS are 5V. (@localroger)

    But when it comes to conserving I/O pins in a design I am all for it, I could never understand why some designs use up so many I/O pins without any thought to design flexibility, being able to adapt for changing needs or simply expansion. The I2C bus (using the same pins as the EEPROM since it's a bus) are always brought out to a standard connector with ground and +5V and always I have these lines available as another 4 pin row as part of the Prop plug header. This becomes my direct connection to the EEPROM for cloning or as an expansion connector in runtime use. The I2C SCL and SDA also serve as SPI CLK and MOSI data in many designs as there is no conflict either. I have never had any need to run separate I/O for another I2C bus except once where I had I/O left over and the pcb layout was very tight.

    For RS485 I only need 2 I/O, one for transmit/receive data and one for transmit/receive enable. For audio out stereo is really redundant (isn't it?) so I just run mono to a stereo jack. Parallel LCDs I run in write only mode since read mode is redundant and problematic and although I have a tendency to run 8-bit vs 4-bit data it's because I frequently use the same lines for a 4x4 keypad (the LCD data bus has its own pullups too). If I/O is scarce then LEDs always belong on a shift register or I2C expander, you can put as many as you like on your board and not use up any I/O or maybe one as the latch for a shift register running from I2C CLK&DAT.

    For A/D many discrete A/D converters are limited and relatively expensive whereas a $1 PIC/AVR/8051 style chip is easily programmed and can interface via I2C or even just automatically stream out conversions in single pin asynch serial as I do over isolation barriers.

    Not only can you optimize I/O but you can also rationalize connectors. Why for instance do you really need a big VGA connector or even PS/2? These are easily handled off board via a short pin header to "a whatever you need" cable while the otherwise small pcb stays clean and simple. In fact many PS/2 compatible keyboards these days are USB with PS/2 protocol availble, the "adaptor" does nothing and is bulky, so just connect the USB plug to a USB socket and talk to it in PS/2 protocol. Now talking about optimizations I see that many designs still use ancient and bulky HC49 style crystals when there are so many tiny SMD or cylindrical products available that are even cheaper too, including MEMS oscillators. The HC49 blocks so may I/O pins yet a small SMD crystal/TXO can sit right up against the Prop and you still have plenty of room to route I/O cleanly. I think I said enough for now :)

  • I started working on this because I tore down a medical chemistry analyzer. It had an error code and I was curious what it was. So, I found the article on reading eeproms and decided to give it a try. I have a bunch of old circuit boards with eeproms on them and I'm curious to see what's on them. Also, I am new to micro-controllers(though not programming) and so I wanted to use it as a way to learn more about them. That's one of the main reasons I bought the Prop; because of it's potential for multi-core programming. It pressed all of my nerd buttons. Anyway, I bought a bunch of shift registers and will update this post later when I have more information.

    I appreciate everyone's magnificent input. I am learning so much on this topic and am excited to learn more. If you have any ideas of projects I could do to learn more about the Prop, please let me know. I am always willing to learn.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-02-11 18:53
    justjoey wrote: »
    I started working on this because I tore down a medical chemistry analyzer. It had an error code and I was curious what it was. So, I found the article on reading eeproms and decided to give it a try. I have a bunch of old circuit boards with eeproms on them and I'm curious to see what's on them. Also, I am new to micro-controllers(though not programming) and so I wanted to use it as a way to learn more about them. That's one of the main reasons I bought the Prop; because of it's potential for multi-core programming. It pressed all of my nerd buttons. Anyway, I bought a bunch of shift registers and will update this post later when I have more information.

    I appreciate everyone's magnificent input. I am learning so much on this topic and am excited to learn more. If you have any ideas of projects I could do to learn more about the Prop, please let me know. I am always willing to learn.

    That's great joey, btw, welcome to the Parallax forum! But even us experienced guys wouldn't bother trying to find out about old instruments by reading binary code from EPROMs. You really need the source code, not even a good disassembly listing is of much use either unless you were really determined and had lots of time. Error codes are horrible things, who really knows what they mean? This is a lesson that you can take to heart and if you ever design something that others have to use, then put in helpful diagnostic messages, even if they are only reported via an optional serial terminal or logged on an SD card, it is always better than those dreaded "error codes".

    Once you hook up those shift registers and start reading EPROMS, which takes a few seconds at most per EPROM, what do you do with your reader, it's got nothing left to do as you spend weeks disassembling and reconstructing the source from those binary images :) Why not at least put some LEDs on those shift registers, then at least you can blink and chase LEDs. Tie a Prop I/O to the OE pin of the registers and you can modulate the LEDs and make them dimmer or even play with interesting effects from mixing update and modulation frequencies. What's you area of interest? Maybe develop some skills in that area, build on that so you can tackle those more daunting projects.

  • It may be just a complete waste of time... but it's still fun lol. Plus, I'm learning about how the eeprom works. After I read out the code, I'll probably then write some code to write to the prom; just have some fun with it.

    I have many interests. Right now, I have all of these old circuit boards that have a lot of classic chips on them (like the 6800 mcu). I want to see if I can interface with them and use them with the prop. There are several RAM chips, I got a whole bunch of flash chips, and a bunch of other generic stuff. It's not so much what I can use the chips with in larger projects, as much as it is learning about interfacing with them. But that's for now.

    I really like working with code close to the hardware level, as opposed to what I usually do at the higher levels. That's why I asked for input (and I may be drifting off the original topic) as to what I should do next. While I'm waiting for my parts to come in, I'm trying to come up with other things to do with my Prop.

    I have a bunch of "Octal Buffer/Line Drivers" that I have no clue what they are. Maybe I can figure out those and what I could use them for lol.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-02-12 16:51
    Trouble is a lot of this old tech is just plain junk. I am partly clearing out the workshop at present and managed to fill 4 big boxes so far full of circuit boards, parts, blank pcbs etc. These are boards with AVRs, MSP430s, ARMs, PICs, etc that sound like they are much more modern than the stuff you are playing with yet it is junk. I sent a photo of the junk to my young friend Jack who drove over all excited on his learner plates with his Dad and filled the boot of his car with the lot! Good on ya Jack!

    If you want "junk" I can ship it over by the crate load but why waste your time with chips that were designed for 5V and data and address buses when modern MCUs have no need for these chips and trying to use them is so clunky and redundant. I have a lot of fun with the Prop as it is, interacting live with the hardware at the hardware level using my Tachyon Forth and getting instant results. If you really like playing with hardware you should try it, it is a lot of fun and very productive.

  • kwinnkwinn Posts: 8,697
    One of the things that can be done with the code from those eproms is to use it to use the propeller as an emulator for whatever cpu chip/hardware was executing that code.

    Not very useful unless you are trying to put whatever machinery it was connected to back into use, but definitely very educational. The propeller can emulate most of the older minicomputers/microprocessors at or close to their original speeds.
  • zx81vgazx81vga Posts: 56
    edited 2017-02-15 09:30
    Hello Propellerfriends,

    @justjoey

    I think i can help you,

    I like these old EPROMS with the magic Window :smile:

    I created this Schematic:

    eprom-read_1.0.jpg

    eprom-read_1.jpg

    eprom-read_2.jpg

    Tested with 2764 (8K), 27128 (16K), 27256 (32K) and 27512 (64K).
    It works good for me.

    Have Fun

    Werner
    1014 x 722 - 87K
  • zx81vga wrote: »

    I like these old EPROMS with the magic Window


    How about a limited anniversary edition Propeller D40 with a moon roof, and an RGB LED to showcase it.
  • Wow! That's incredible! Thank you for posting this. I'll have to give this a try.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2017-02-15 16:23
    :nerd:
Sign In or Register to comment.