Adding Ports status to a variable


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    I am presently powering the circuit from PICKIT2 but this circuit will eventually be powered by batteries.
    The DC motor requires 1.5 to 4.5V and the datasheet for 628A indicates an operating voltage range of 2.0V to 5.5V.
    I was hoping to have 2 pairs (series) of AA in parallel to supply 3 V. but the circuit as above will not work under 4.0V (with the LED)
    I don't want to add a regulator if possible. I have in mind a 6V SLA battery and I am thinking of adding a diode in series (drop 0.7V) to supply the PIC and another diode to further drop another .7V for the motor.
    Do I have other alternatives?

    Mike

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    Hi,
    I'd probably use a LDO regulator for the PIC and run the motor directly off the battery. You can always limit the dutycycle of the PWM to ~75% so that the motor never sees more than 4.5V average if that's critical. Running the motor directly off the battery would allow the motor to operate closer to its top speed even when the battery voltage has dropped a bit, (but then you obviously need to go above 75% dutycycle). If you use a 3.3V regulator for Vdd and as reference for the ADC you could monitor the battery voltage thru a voltage divider and use the result to compensate the PWM dutycycle as the battery voltage drops.

    If you really don't want to use a regulator I guess you could use a diode or two but that would make monitoring the battery voltage a lot trickier.

    /Henrik.

  3. #3
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    As the circuit will not work under 4V I guess I would need to supply 5V so I will be using a 6V SLA battery. I think I will stick with a couple diodes. About reducing duty cycle I was under the impression that although the pulses are a % of the time, each pulse is still at full voltage but if reducing duty cycle is ok then I can do this for the motor.

    Thank you for the information.

    Mike

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    Hi,
    I can't see why the circuit wouldn't work below 4V. If the LED is a white one then I understand but if it's a normal red or green with ~2V forward drop then you should be fine on 3.3V. Besides, the LED is to be replaced by the transistor, right?

    Yes, the pulses are still at the full voltage and you are correct that it's something you should take into consideration however I don't think it would be a problem in this case. It's quite normal to run hava a higher power supply voltage in order to compensate for the I*R-drop in the windings etc, I don't think 25% "overvoltage" would be a problem. Do you have a datasheet on the motor?

    /Henrik.

  5. #5
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    I actually have a blue LED 3.5V forward, I just tried with a red LED 1.9V forward. The whe I hit 3.9V the PWM doesn't work, the LEDs remain at full intensity (Dimmed by the lower voltage but no difference from changing the POT).
    Here is the datasheet for the motor (model 2295)

    Mike

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    Hi,
    Personally I wouldn't worry about running the motor off a 6V supply.
    As for the circuit not operating properly below ~4V the only think I can think of is the POT command not doing the business. The manual says that the Pot/resistor should be 5-50k, you have 100k. It says to adjust Scale contstant to a lower value for large RC constants, you have the scale set to its maximum. Perhaps that's got anything to do with it.

    /Henrik.

  7. #7
    Join Date
    May 2009
    Location
    Montreal, QC, Canada
    Posts
    118


    Did you find this post helpful? Yes | No

    Default Re: Adding Ports status to a variable

    Since my first post, I have reduced the POT to 50K and I've used the code example given in the PBP book to adjust the scale and my value is now set to 30 so this is a mystery but I am not so concerned.
    I will use 2 diodes to supply the PIC and run the motor off the 6V, anyway the goal is to reduce the motor speed so it will be set to probably half duty-cycle. I didn't receive the motor yet but fingers crossed.

    Thank you Henrik for your help.

    Mike

Similar Threads

  1. activating i/o ports according to variable value
    By Picman in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 29th July 2010, 13:55
  2. accessing ports pins using an index variable
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th March 2008, 20:36
  3. adding new word variable ?
    By iugmoh in forum General
    Replies: 4
    Last Post: - 21st February 2008, 00:26
  4. STATUS re-curtain W
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th February 2005, 15:21

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