Eeprom question


Closed Thread
Results 1 to 7 of 7

Thread: Eeprom question

  1. #1
    Join Date
    Mar 2008
    Posts
    79

    Default Eeprom question

    I know lots will say use the search button and google it, but the answers I've come across are too complex and not in simple simple enough words.

    My question is:

    How do you attach an Eeprom to a Pic and store parts of the program in it and then call that when running the program in the Pic

    for example If I was to play with "Roman Black Sound" program/examples it needs way more space than is in the Pic, i.e. needs an eeprom, how would I connect the eeprom and address it while writing and reading

    Hope I've explained my question enough for people to understand what I'm asking.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Depends on how much data you want to store off chip.

    Standard serial eeprom (i.e. 24LC256 type) - easily done, 32K (or more depending on chips used) off PIC storage, PBP supports it directly (thru I2CRead/I2CWrite commands), and so on...(and you could program the chip directly using the PICKIT2)

    ATMEL Dataflash chip - not as easy as a 24LC256 type, only uses a few pins, can use PBP's ShiftIn/ShiftOut instructions to access the memory. But you have to learn how to access it first (not sure if the PICKIT2 can program those directly, I don't think so, but I could be wrong)

    SD card - not so easily done, a few more pins than a 24LC256, have to write your own software/shifting code to access the card, but you can store a load of data on it obviously. Could load the files onto the card and then plug it in but you still have to write the software to access the FAT16/FAT32 data on it.

    Hard drive/Compact Flash card - again, not so easily done, cheap, but uses a lot more pins than either of the above methods. And again, have to write your own routines to access the drive in IDE mode.

    Probably a few more methods I've forgotten....

    EDIT: and there is...
    You could get a large PIC such as a PIC18F8722 and use it in the 'Microprocessor' mode where all of your program and data is stored off the PIC and accessed thru an Address and a Data bus (like the old school Z-80/6809E/6502/etc but with more memory and a lot more options and speed).

  3. #3
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Smile EEPROM with PIC16F684

    I will be using the same stuff.

    PIC16F684 and 24LC08B EEPROM from Microchip

    I will use:

    counter VAR BYTE
    counter = 25
    getcounter VAR BYTE
    getcounter = 0

    'datapin PORTC.4
    'clockpin PORTC.5
    'block 0 from 4, address 0 of the 256bytes block

    I2CWRITE PORTC.4,PORT5,%10100000,0,[counter]
    PAUSE 10
    I2CREAD PORTC.4,PORT5,%10100000,0,[getcounter]

    and getcounter will obtain the value of 25, right?

    Connect pins 1 - 4 and 7 to GND.
    Connect pin 8 to VDD
    Connect pins 5 and 6 to VDD thru 4.7K wpu
    Connect pin 5 to PORTC.4
    Connect pin 6 to PORTC.5

    Right?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    In theory YES, in in reality no. You should read the following link carefully.

    I2CRead & I2CWrite not working as expected
    http://www.picbasic.co.uk/forum/showthread.php?t=587

    AND THEN read also carefully your datasheet, cause you'll need to modify the way to write your ControlByte AND the Address variable to follow the exact requirement. (ie. how to access all 4 different 256 Bytes block of your EEPROM)

    Page 6 of this PDF
    http://ww1.microchip.com/downloads/e...doc/21710c.pdf
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by karenhornby View Post
    My question is:

    How do you attach an Eeprom to a Pic and store parts of the program in it and then call that when running the program in the Pic

    Hope I've explained my question enough for people to understand what I'm asking.
    I don't think you can do that with serial EEPROM.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I think he meant the Audio File, 'cause Romans's Black software is not that big.

    Even if it's true, i have some doubt of the sound quality at the end, should be longer to access the EEPROM than the code space huh?. Never tested it though.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    xnihilo's Avatar
    xnihilo Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    In theory YES, in in reality no. You should read the following link carefully.

    I2CRead & I2CWrite not working as expected
    http://www.picbasic.co.uk/forum/showthread.php?t=587

    AND THEN read also carefully your datasheet, cause you'll need to modify the way to write your ControlByte AND the Address variable to follow the exact requirement. (ie. how to access all 4 different 256 Bytes block of your EEPROM)

    Page 6 of this PDF
    http://ww1.microchip.com/downloads/e...doc/21710c.pdf
    Thank you!

Similar Threads

  1. Can't read sequential addresses in external EEPROM
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2010, 14:46
  2. Problem with I2C EEPROM addressing
    By Atom058 in forum General
    Replies: 14
    Last Post: - 3rd November 2009, 03:17
  3. How to write/read strings EEPROM/LCD
    By g-hoot in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 11th February 2007, 06:26
  4. EEPROM Question
    By pramarn in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th October 2006, 03:24
  5. word variable to 25lc640
    By TONIGALEA in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 6th July 2004, 19:59

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts