Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Proto Boards and using upper 32KB of AT256 EEPROM for storing data. — Parallax Forums

Propeller Proto Boards and using upper 32KB of AT256 EEPROM for storing data.

JamesRonaldJamesRonald Posts: 39
edited 2010-04-25 00:40 in Propeller 1
So I was looking at at my Propeller Proto Board the other day and I noticed that it has an AT256 EEPROM (64KB) like it says in it products description. Interestingly, the schematic shows a 128Kbit part. Anyway, my question is can the upper 32KB ( > $8000) be used for storing data? I wonder why there is not more discussion on doing such.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James Ronald
My Robots

Post Edited (JamesRonald) : 4/11/2010 2:26:43 AM GMT

Comments

  • LeonLeon Posts: 7,620
    edited 2010-04-10 19:29
    It can be used, and there has been some discussion of it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • hover1hover1 Posts: 1,929
    edited 2010-04-10 19:49
    Did you mean AT512 (64x8)? That's what on all my Proto Boards.

    You can use all of the 32K above the original 32K. There has been much discussion, but searches are not working in the forum right now. I'll see if I can track down some threads.

    Jim

    Good catch on the schematic. Don't know if it's a documentation error, or they had another part in mind.
  • LeonLeon Posts: 7,620
    edited 2010-04-10 20:32
    This code shows how to do it:

    
    CON
      _clkmode      = xtal1 + pll16x
      _xinfreq      = 5_000_000
      _stack        = 50
        
      i2cSCL        = 28
    '  i2cSDA        = 29 
    
    
    
      EEPROMAddr    = %10101000
    
      ' EEPROM data base address - i.e 32K (assumes a 64kb eeprom installed!!)
      EEPROM_Base     = $8000
      
      ' debug - USE onboard pins
      pcDebugRX       = 31
      pcDebugTX       = 30
    
      ' serial baud rates  
      pcDebugBaud     = 115200
    
        
    VAR
      long  i2cAddress, i2cSlaveCounter
    
    OBJ
      i2cObject      : "basic_i2c_driver"
    
      debug          : "Debug_PC"
    
      
    pub Start
        ' start the PC debug object
        debug.startx(pcDebugRX,pcDebugTX,pcDebugBaud)
      
        ' setup i2cobject
        i2cObject.Initialize(i2cSCL)
    
        ' pause 5 seconds
        repeat 10
            debug.putc(".")
            waitcnt((clkfreq/2)+cnt)
        debug.putc(13)
      
        ' i2c state
        debug.strln(string("Logger program (v1.0)"))
    
        ' demo the EEPROM
            if i2cObject.devicePresent(i2cSCL,eepromAddr) == true
                debug.strln(string("EEPROM Present"))
                EEPROM_Demo
            else
                debug.strln(string("EEPROM Missing"))    
            waitcnt(clkfreq*3+cnt)
    
            
    
    
    PRI EEPROM_Demo | eepromData, eepromLocation, ackbit
        ' demo the i2c Serial EEPROM (Microchip's 24LC512 (64kb))
        debug.strln(string("EEPROM DEMO"))
          
        ' ***** EEPROM read/Write example *****
        eepromLocation := EEPROM_Base
        eepromData := 0
        
        repeat 10
            ' write long
            eepromData += 100
            i2cObject.WriteLong(i2cSCL, EEPROMAddr, eepromLocation, eepromData)
    
            ' read long
            eepromData :=0
            eepromData := i2cObject.ReadLong(i2cSCL, EEPROMAddr, eepromLocation)                
    
            ' debug
            debug.str(string("Read Location="))
            debug.decx(eepromLocation,5)
            debug.str(string(", data="))
            debug.decx(eepromData,5)
            debug.putc(13)        
            
            ' next    
            eepromLocation +=4
    
            ' slowit
            waitcnt(clkfreq/2 + cnt)
    
        ' done
        debug.strln(string("EEPROM demo done."))        
     
    
    
    



    It uses other code from the Obex.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM

    Post Edited (Leon) : 4/10/2010 8:47:56 PM GMT
  • JamesRonaldJamesRonald Posts: 39
    edited 2010-04-11 02:42
    What a pleasant surprise.

    I have been watching the propeller and robotics forums for a couple years now and do not remember this topic coming up.

    Thanks for the help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James Ronald
    My Robots
  • LeonLeon Posts: 7,620
    edited 2010-04-11 07:10
    I'm not sure where that code came from originally. It was probably in the Obex. I think it worked OK when I tried it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Leon Heller
    Amateur radio callsign: G1HSM
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-04-11 10:23
    IIRC mctrivia has some code in the OBEX that uses the upper eeprom.
    Here is another in the OBEX that stores and retrieves data from eeprom. I am unsure if this just accesses 32KB but it could no doubt be modified. http://obex.parallax.com/objects/493/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • caskazcaskaz Posts: 957
    edited 2010-04-24 12:53
    Hi.

    I tried above code.
    But not operate. (all data are FFFFF)

    I checked ProtoBoard(AT24C512)
    I modify to EEPROMAddr := %10100000).
    I comment out " if i2cObject.devicePresent(i2cSCL,eepromAddr) == true", because there is no method "devicePresent" in object"basic_i2c_driver"

    Why cannot data read?
  • train nuttrain nut Posts: 70
    edited 2010-04-24 13:46
    I have been using the object "bs2_functions" from the objext exchange and it works wonderful for writing to the upper 32K of a 24c512 EEPROM. Use methods Read_Highmem and Write_Highmem to write and read to EEPROM. Hope this helps.

    Ben
  • caskazcaskaz Posts: 957
    edited 2010-04-25 00:40
    Thanks, train nut.
    I modified below.
    It fine works.

        eepromLocation := 0
        eepromData := 0
        
        repeat 10
            ' write long
            eepromData += 100
            'i2cObject.WriteLong(i2cSCL, EEPROMAddr, eepromLocation, eepromData)
            BS2.Write_HighMem(eepromLocation, eepromData, 4)
    
            ' read long
            eepromData := 0
            'eepromData := i2cObject.ReadLong(i2cSCL, EEPROMAddr, eepromLocation)   
            eepromData := BS2.Read_HighMem(eepromLocation, 4)
    
    
    



    Why doesn't i2cObject.WriteLong/i2cObject.ReadLong work?
    I don't understand reason although reading basic_i2c_driver.
Sign In or Register to comment.