need resources on Microwire 3 Wire interface eeprom control


Closed Thread
Results 1 to 7 of 7
  1. #1
    EDWARD's Avatar
    EDWARD Guest

    Default need resources on Microwire 3 Wire interface eeprom control

    i have a pic16f73 at 4 mhz. i have a microchip 93c46 eeprom connected to the pic. i am tring to write variables to the eeprom before powerdown and then recall them at power up. i cant find any webpages or anything that even shw what commands to use. imm pretty sure i can't use I2CREAD commands. i have a picture of my layout. i just need to get pointed in the right direction. i think i need the microwire 3 wire interface, is this right?

    I only have like 6, single byte sized variables i need saved, and they are only updated if they are changed and then pic is shutdown, and they arent changed that often.

    also, does the 16f73 have onboard eeprom? and do i need to define stuff before i can use it? i have looked mad hard at the datasheets.
    Attached Images Attached Images  

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You'll need to use Shiftin/Shiftout for SPI EEPROMs. Here's an example.
    http://www.microengineeringlabs.com/...1/pbp/spix.bas
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    if you want to use the internal EEPROM use READ and WRITE command. You don't need to declare anything else. Everything is explain in the PBP manual.
    Steve

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

  4. #4
    EDWARD's Avatar
    EDWARD Guest


    Did you find this post helpful? Yes | No

    Default

    thank for the replys.

    i have tried using the read command and the write command. it gives me errors in my program at the compiing stage. it says something like undefined symbol 'WREN" or undefined symbol 'pgd' or somehing theres about 6 in all.

    i am using the 16f73 and i think that the data sheet for it says that there is non-volatile eeprom memoery onboard that i can use. but not 100% sure if my pic has this memory.

    i will look into the shiftin commands. thanks

    i am simply trying to store about 6, byte sized variables in all. the variables are to be saved at power down and loaded at power up.

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


    Did you find this post helpful? Yes | No

    Default

    i didn't read the datasheet but i'll trust you on the fact it doesn't have any internal EEPROM. In this case, you can still skip the external EEPROM idea and use the code space to save your variables.

    see this thread from Melanie
    Steve

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

  6. #6
    EDWARD's Avatar
    EDWARD Guest


    Did you find this post helpful? Yes | No

    Default eeprom control

    thanks for the help so far. sry i got back to this so late but i haven't yet solved this problem. since my boards are already have an external eeprom (93c46), i have decided to use it. i just cant grasp how the eeprom works and need help understanding some things.

    1. Does the eeprom have command instructions seperate from data instructions?

    2. how does the informatiopn flow? are there byte sized instruction signals that tell the eeprom to get ready for data then it sends the data byte?

    3. or is the instrunction on the msb of a word or something? or a bit in the sequence?

    4. do i need to define a port speed?

    if you dont want to answer these can you suggest any references that have an example of writing and reading from these external eeproms?

    i have a pic of how my eeprom is on the pcb on a post by me, in this topic.

    thanks!

    oh yeah, i really would like an example that doesnt have lcd stuff in it

  7. #7
    EDWARD's Avatar
    EDWARD Guest


    Did you find this post helpful? Yes | No

    Default still need help

    I am trying to write just 3, byte sized variables to the external eeprom and recall them at power up.

    heres the data sheet for my eeprom:
    http://www.datasheetarchive.com/sear...c46&sType=part

    what should my trisB and TRISC be?? are they all outputs except for D0 (data out on epprom)



    CS - PORTB.1
    CLK - PORTB.2
    D1 - PORTC.6
    D0 - PORTC.7

    this is what i have so far:


    include "modedefs.bas"

    D var byte
    T var byte
    ED var byte

    addr var word
    B0 var byte


    eeread:

    for addr = 0 to 2 'eeprom address

    PORTB.1 = 1 'cs = 1
    Shiftout PORTC.6, PORTB.2, MSBFIRST, [$03, addr.byte1, addr.byte0]
    PORTB.1 = 0 'cs = 0

    PAUSE 1

    PORTB.1 = 1
    Shiftin PORTC.7, PORTB.2, MSBPRE, [B0]
    PORTB.1 = 0

    if addr = 0 then
    d = B0
    endif

    if addr = 1 then
    t = B0
    endif

    if addr = 2 then
    ED = B0
    endif

    next addr
    return







    eewrite:
    for addr = 0 to 2

    if addr = 0 then
    B0 = D
    endif

    if addr = 1 then
    B0 = T
    endif

    if addr = 2 then
    B0 = ED
    endif

    PORTB.1 = 1
    Shiftout PORTC.6, PORTB.2, MSBFIRST, [$06]
    PORTB.1 = 0

    PAUSE 1

    PORTB.1 = 1
    Shiftout PORTC.6, PORTB.2, MSBFIRST, [$02, addr.byte1, addr.byte0, B0]
    PORTB.1 = 0

    next addr
    return


    this is not all the code, but i want "encapsulated" SUBs that will take care of the reading and writing to the eeprom. so that is all i have shown.

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. microwire eeprom 93c06, 14,46.....
    By darkman in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 10th March 2009, 14:27
  4. 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
  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 : 1

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