PIC16F84A EEPROM problems


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default PIC16F84A EEPROM problems

    Hi, ive been searching google for about 3 hours now but still not found the answer.

    My code needs to read/write a single byte on EEPROM. When i use the read command i get a weird value returned (usually 127, i have no idea where that comes from) and when i use write the chip resets ifself.

    I'm new to using EEPROM but it looked simple till i tried to use it

    Heres a cut down sample of my program

    taddress var byte
    taddress=20
    write 0,taddress

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    Heres a cut down sample of my program

    taddress var byte
    taddress=20
    write 0,taddress
    That code snip really doesn't tell us anything. Post the whole thing. You've got a DEFINE wrong somewhere, maybe some conflicting interrupts, who knows...
    Maybe change the handle from 'The Master' to 'Maybe the Master in the Future, but for now, I can't get a simple EEPROM write to work'...

  3. #3
    Join Date
    May 2006
    Location
    Kedah, Malaysia
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    That code snip really doesn't tell us anything. Post the whole thing. You've got a DEFINE wrong somewhere, maybe some conflicting interrupts, who knows...
    Maybe change the handle from 'The Master' to 'Maybe the Master in the Future, but for now, I can't get a simple EEPROM write to work'...
    Maybe he is master in other field.

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fazan83 View Post
    Maybe he is master in other field.
    too right :P thats my name on other forums. just keeping it the same. im good at VB6 etc

    ive not defined anything so far and ive not got any interrupts. the example i saw on the net didnt say to define anything

    http://www.microengineeringlabs.com/...les/pbc/ee.bas

    everything else in the program works fine. all the serin/serout if then elses etc. its just read/write that dont work

  5. #5
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    righty. now im at home i can give you th full code. i made an new test program and it still doesnt work

    Code:
    trisa=%00000000
    trisb=%00000000
    
    t1 var byte
    
    high portb.0
    pause 100
    low portb.0
    pause 100
    
    
    high portb.3
    pause 100
    low portb.3
    pause 100
    
    read 0,t1
    
    portb=t1
    
    end
    it has 8 LEDs connected to portb. 2 of them flash on startup to prove the chip is working then it should read a value from EEPROM[0] and display it using the LEDs.

    i set the EEPROM values in the programmer software before programming. if i read everything back from the chip then i can see it definately has set the EEPROM.

    no matter what value i put in the EEPROM the LEDs always tell me the value is %11111110

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Instead of END, try STOP, or a read/portb/goto loop, see what happens.
    Do you have anything across Vss & Vdd?

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. Problems with driving external EEPROM M24256
    By Kristjan in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 10th February 2008, 11:34
  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 : 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