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)

    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

  2. #2


    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

  3. #3


    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

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

    The internal oscillator runs at 500 Khz on power-up, which is 1/64th the 32 Mhz PBP is expecting.
    So if you put it before the OSCCON statement, it will be equivelent to PAUSE 6400 or 6.4 seconds.

    I'll try it on some real hardware tomorrow.
    DT

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: EEPROM Variables (EE_Vars.pbp)

    That solved the 6 sec delay (by moving the 'pause 100' to after the OSCON statement) but it still spins up to max RPM ...

    Nacelle_Motors_16F1825_32Mhz_Int_SN754410_Alt_Btn.txt

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

  7. #7


    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.

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

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