Shop OBEX P1 Docs P2 Docs Learn Events
Trying to read a EPROM — Parallax Forums

Trying to read a EPROM

TCTC Posts: 1,019
edited 2014-02-22 13:48 in Propeller 1
Hello all,

I am staring to go crazy, I am just trying to read a EPROM.

Here is the full code.
CON
        _clkmode = xtal1 + pll16x                                               'Standard clock mode * crystal frequency = 80 MHz
        _xinfreq = 5_000_000


CON     'pin

  A0            = 8
  A14           = 22

  D0            = 0
  D7            = 7

  CS            = 24
  OE            = 27

  IO_OE         = 26 
VAR
  long  address
  byte  Data
   
OBJ
  PST      : "Parallax Serial Terminal"
  
PUB main

  PST.start(115_200)
  dira[A0..A14] ~~
  dira[CS] ~~
  dira[OE] ~~
  dira[IO_OE] ~~
  dira[D0..D7] ~

  outa[A0..A14] := 0
  outa[CS] := 1
  outa[OE] := 1
  outa[IO_OE] := 1              'turn on the translator

  PST.str(string("Address,Data"))
  PST.NewLine

  repeat address from $0000 to $7FFF

    PST.hex(address,4)
    PST.char(44)
    outa[A14..A0] := address

    outa[CS] := 0
    outa[OE] := 0

    Data := outa[D7..D0]
    
    PST.hex(Data,2)
    PST.NewLine

    outa[OE] := 1
    outa[CS] := 1

    waitcnt(clkfreq + cnt)      'wait 1 second

I can send the address to the EPROM, if I hook up LED's to the props I/O's I can see the address counting up.
I can see both "/CS" and "/OE" going on and off.
I can see the data on the EPROM's data bus (D0 to D7), But the prop refuses to read the inputs. For the life of me I cant figure it out. The prop should be good, it is about 2 weeks old. It has to be the code, but I cant see it.

HELP PLEASE!!! I am at the end of my rope of always running into problems, problems I should not be having.

Thanks
TC

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-02-22 10:51
    Why not visit to OBEX to get some i2c drivers?

    http://obex.parallax.com/search/EEPROM

    This one in particulaar is good.
    http://obex.parallax.com/object/23
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-02-22 10:52
    Try ...
    Data := ina[D7..D0]
    

    instead of
    Data := outa[D7..D0]
    
  • TCTC Posts: 1,019
    edited 2014-02-22 10:56
    That did it, Thank you. I have no idea why i did not see that.
  • TCTC Posts: 1,019
    edited 2014-02-22 11:08
    Publison wrote: »
    Why not visit to OBEX to get some i2c drivers?

    http://obex.parallax.com/search/EEPROM

    This one in particulaar is good.
    http://obex.parallax.com/object/23

    Because it is not a "EEPROM" it is a "EPROM" They are not the same. The one I am reading is parallel, 15 address lines, 8 data lines, a /CS line, and a /OE line
  • PublisonPublison Posts: 12,366
    edited 2014-02-22 13:18
    TC wrote: »
    Because it is not a "EEPROM" it is a "EPROM" They are not the same. The one I am reading is parallel, 15 address lines, 8 data lines, a /CS line, and a /OE line

    Sorry TC,

    That's what I get for try to answer a question after being up for 36 hours straight. EPROM and EEPROM kinda look the same with one eye open. :)

    Very familiar with EPROM's. I have my first 1702 (Altair 8800), and a couple of dozen 2708's.

    http://en.wikipedia.org/wiki/EPROM
  • TCTC Posts: 1,019
    edited 2014-02-22 13:48
    Publison wrote: »
    Sorry TC,

    That's what I get for try to answer a question after being up for 36 hours straight. EPROM and EEPROM kinda look the same with one eye open. :)

    Very familiar with EPROM's. I have my first 1702 (Altair 8800), and a couple of dozen 2708's.

    http://en.wikipedia.org/wiki/EPROM

    It's cool, been there more times then I want to remember.

    This is my first time trying to read from one. So I am a little bit of a newbe.
Sign In or Register to comment.