PIC16F84A EEPROM problems


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    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

  2. #2
    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?

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Instead of END, try STOP, or a read/portb/goto loop, see what happens.
    Do you have anything across Vss & Vdd?
    i tried the loop

    Code:
    loop:
    read 0,t1
    portb=t1
    goto loop
    still same result.

    what might i have accross vss and vdd? do you mean power or components? i have power because the LEDs work. i also have a capacitor before the regulator or the chip wont work

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    what might i have accross vss and vdd? do you mean power or components? i have power because the LEDs work. i also have a capacitor before the regulator or the chip wont work
    How about a little something, like a .1uf across Vdd and Vss on the PIC itself?

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    How about a little something, like a .1uf across Vdd and Vss on the PIC itself?
    hmm, do i really need that? the origional diagram i had a few years back shows 1 there but i tried removing it and it didnt appear to affect anything.

    ill try and find one. its not something i have laying around :P

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


    Did you find this post helpful? Yes | No

    Default

    Try..
    Code:
            @   __CONFIG _XT_OSC & _WDT_OFF & _CP_OFF
            
            PORTB = 0
            TRISB = 0
            
            DATA 0,1,2,4,8,16,32,64,128
            
            Addr var byte
            
            for Addr=0 to 8
                read Addr, PORTB
                PAUSE 500
                NEXT
                
            STOP
    and make sure you have MCLR pin tied to VCC via a resistor. Cap always have to be there. 0.1, 0.22, 0.47 or whatever else in that range.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    ok, i copied that exactly. it wouldnt compile because of the top line so i removed it and set the fuses in the programmer software. i borrowed one of those caps from another circuit and its still not working. im getting the exact same result

    Edit: MCLR is connected to vdd with a 10K resistor
    Last edited by The Master; - 11th June 2007 at 20:46.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by The Master View Post
    hmm, do i really need that? the origional diagram i had a few years back shows 1 there but i tried removing it and it didnt appear to affect anything.

    ill try and find one. its not something i have laying around :P
    That was then, this is now... Just bad design practice NOT to use one, I don't think you'll find anybody who will dispute that fact. Just because it worked once, doesn't mean it'll work like that every time...however, conversely, you'll have a hard time finding a PIC that won't run because one is installed (vs. one without a cap installed).

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