EEPROM Variables (EE_Vars.pbp)


Closed Thread
Results 1 to 40 of 80

Hybrid View

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

    I've run your program here on real hardware and real programmers.
    I still cannot duplicate your reported problems.

    The EEPROM is initialized correctly on the first run after programming.
    The PWM ramps up to 150 dutycycle every time, and never goes to 255.
    I'm measuring the dutycycle with an oscilloscope. I do not have motors hooked up.

    I've used an melabs U2 programmer.
    I've also used a PICkit3 programmer, and single stepped through it.
    It always works exactly like it should.

    What are your software versions (PBP3 and meProg)?
    How are you driving the motors?
    Do you have a scope?
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Here's what I've observed:
    • Just adding the 'pause 100' doesn't seem to change anything
    • Adding 'MotorRPM = 127' just before the spin up does work (although negating the use of EEPROM)
    • I know the motors are spinning up to their max cycle becuase I have a mechanical rotary encoder which allows me to adjust the RPM; when I turn the knob CW the speed does **not** increase, while turning it CCW does reduce the speed. Also, this rotary encoder has a push button which I've set up to return the motor speed to default - this also works
    • If I alter the speed (either by adjust the RPM up or down, or pressing the 'reset' button), the chip remembers this value the next time it's powered up
    • If I grab a brand new chip, never previously programmed, it works straight away

    I don't have a scope, Darrel - I wish I did Hopefully the above is helpful. Here are my version details:
    • OS: Windows 7 (running on a VM on my MacBook Pro)
    • MicroCode Studio Plus: 5.0.0.3
    • PicBasic Pro compiler: PBPX 3.0.6.4
    • meLabs Programmer: v4.50 (with the U2 programmer)

    Here are the two .pbp files (the only difference being the addition of the 'MotorRPM = 127'):

    Nacelle_Motors_16F1825_32Mhz_Int_SN754410_2.txtNacelle_Motors_16F1825_32Mhz_Int_SN754410.txt

    I've shared my .hex & .asm files here.

    Here's my schematic. I'm using a SN754110 to drive the motors:

    TOS_E_Rev2.pdf
    Last edited by RossWaddell; - 24th October 2012 at 00:31.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    And here's a screenshot of my meLabs programmer settings:

    Name:  meLabs_Prg_Settings.png
Views: 1366
Size:  461.7 KB

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Quote Originally Posted by Darrel Taylor View Post
    Ross,

    I've run your program here on real hardware and real programmers.
    I still cannot duplicate your reported problems.

    The EEPROM is initialized correctly on the first run after programming.
    The PWM ramps up to 150 dutycycle every time, and never goes to 255.
    I'm measuring the dutycycle with an oscilloscope. I do not have motors hooked up.

    I've used an melabs U2 programmer.
    I've also used a PICkit3 programmer, and single stepped through it.
    It always works exactly like it should.

    What are your software versions (PBP3 and meProg)?
    How are you driving the motors?
    Do you have a scope?
    Ross, after reading that, I would put my money on a hardware problem; mis-wired PIC, inadequate power, possibilities are countless.

    You'd be surprised how often I put a resistor backwards.

    Robert

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    But if I use the same chip and re-program it with the first code, it works; if I then pre-program it with the second code, it doesn't. And I can keep going backwards and forwards like that ...

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    Also: after I re-program the new chip from my inventory a second time, the problem re-appears.

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

    •Adding 'MotorRPM = 127' just before the spin up does work
    The default value was 150, so it seems logical that setting it to 127 would make it run slower.

    And I assume this is just a schematic error ?? Might cause a few problems. Sure confused me for awhile.



    Try the attached program.
    Attached Files Attached Files
    DT

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    I just changed it to 127 so it would be even slower to make it obvious. If I use 150 it has the exact same effect.

    Thanks for spotting the schematic error! The board itself is fine, though.

  9. #9


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    BTW, this problem applies to both EE_vars (MotorRPM & PortEngDir) - unless I specifically set them in code they do not get initialized with the default values (150/127 & 0). I know this for the 2nd EE_var because in a later iteration of the same code I do a check on PortEngDir: if it's 0 make the motor spin CCW; else make the motor spin CW. Without the line 'PortEngDir = 0' the motor **always** spins CW after the chip has been programmed more than once.

    Darrel - I missed seeing that you had provided a code file too. I'll try that out tonight after work (and thanks).

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