EEPROM Variables (EE_Vars.pbp)


Closed Thread
Results 1 to 40 of 80

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Looking over my post #49, this recent problem appears to be similar to what I was seeing there (but went away). I don't have enough available pins on my 16F1825 to display the start up value of _MotorRPM but I suspect the same thing is happening - after first programming the chip, the initial value is way over 150 (and why the PWM command to the motor ends up spinning it to its max value [255]).

    I've switched to PBP3 and MicroCode Studio Plus (v5.0.0.3) and PBP compiler vPBPX 3.0.5.4. I tried what you posted in #50 but no lucy. Could this be a case of bulk erase not working? Why would that happen with one project but not another similar one (as I posted in this thread)

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    If I add this:

    Code:
    MotorRPM = 150
    before the the PWM command, all works well (completely negating the use of EEPROM of course) so this does indicate to me that somehow the initial value of _MotorRPM is getting messed up after first programming the chip (if I use my mechanical rotary encoder to reduce the RPM, this does get saved properly and the motor starts up with this saved value next time power is turned on).

    Darrel?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Ross,

    Try putting a pause 100 or so at the very beginning of your program.

    The programmer goes through several cycles of power-on and resets to program each section of memory.
    And the EEPROM write is one of the first things that happens in the program.

    The EEPROM write takes ~5ms, so it's probably getting powered down in the middle of the write cycle.

    With a pause at the beginning, it will insure that the programming cycles are completed before it starts running the rest of the program.

    I've single stepped through the program several times in the simulator, and everything works fine.
    I'm not in the office today, so I can't try it with a real programmer.
    DT

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Thanks Darrel! I'll try that tonight when I get home.

    BTW, I've been using MCLR_OFF in my config but w/o a pull up resistor connected between the MCLR pin and +5v - should I have that resistor?

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    With MCLR disabled, you don't need a pull-up, unless your input requires one for a switch or something.
    And on the 16F1 (Enhanced Core) devices, you don't even need a pull-up when enabled. They have an internal pull-up on MCLR.
    DT

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Thanks again, Darrel! I remember now reading about the internal pull-up in the data sheet. This is what happens when you start a project and come back to it 6 months later

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Hmm. That seemed to work on a simpler project but when I add it to the one I attached above (and which I'm attaching here for you to see) it doesn't help the _MotorRPM problem (motors still spin up to their maximum speed, i.e. MotorRPM >= 255) but what is weird is that it now takes almost 6 seconds for them to start spinning!?!??! I only added a pause of 100.

    Nacelle_Motors_16F1825_32Mhz_Int_SN754410.txt

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. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  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