Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: hazzer123 on May 28, 2007, 05:24:38 PM

Title: Microcontroller power source problems
Post by: hazzer123 on May 28, 2007, 05:24:38 PM
I am starting to build a robot, and have fallen at the first hurdle... I cannot get my PIC controller to work under correct battery power.

I have the PIC outputting servo control signals. I can monitor these with my oscilliscope.

It works when i hook it up to my benchtop powersupply, it works when i hook my 9.6V Ni-Cd power pack up directly (i dont leave it like that for too long). It doesnt work, however, when i power it by the battery, but through a 5V voltage regulator. I know that 9.6V to 5V is a bit silly and will mean a lot of heat output in the regulator, but it is a very temporary solution, and it should work ( at least in my mind).

I have measure the voltage difference across the Vss and Vdd on the PIC and they are 5V. The regulator is outputting 5v correctly. I have no servos wired in yet, so it isnt electrical interference.

Hmmm

Any help would be great.

Harry
Title: Re: Microcontroller power source problems
Post by: Ro-Bot-X on May 29, 2007, 02:25:15 AM
I assume that your benchtop power supply gives you 5  volts regulated, right? You power with that both the PIC and servos?

If you use a voltage regulator as 7805, the input voltage has to be minimum 7.2 volts. So, 9.6 volts is ok and the heat dissipated is relative to the power, so for a small current the 7805 will be just a little warm. You can use a 78L05 (rated 500 mA) that looks like a regular transistor to power the PIC and a regular 7805 (rated 1 A) to power the servos. Actually, you may need more than 1 amp for the servos, that is why people like to use 6 volts batteries. In this case, you power the servos directly from the battery and use a LM2940 to power the microcontroller. LM2940 is a Low Drop Out voltage regulator and needs minimum 5.5 input volts to work.
Title: Re: Microcontroller power source problems
Post by: 555 timer chip guy on May 29, 2007, 09:09:33 AM
it also helps if you put a 10 to 1000 uF capacitor in the positive to negative lines of your regulated voltage
supply.
Title: Re: Microcontroller power source problems
Post by: Admin on May 29, 2007, 05:10:50 PM
Set your power supply to 9.6V and feed that through the 5V regulator to power the PIC . . . does it work?
Title: Re: Microcontroller power source problems
Post by: Brandon121233 on May 29, 2007, 06:50:35 PM
use an ammeter to check and make sure that your battery power supply is able to handle the power requirements for the board.
Title: Re: Microcontroller power source problems
Post by: hazzer123 on May 30, 2007, 03:41:10 AM
I found the solution to my problem. I think it was a faulty voltage regulator...

I stuck a new one in and its fine now. Im not sure why, but on the old one, the voltage dropped to below 3V when any current was supplied.

Thanks
Title: Re: Microcontroller power source problems
Post by: hazzer123 on May 30, 2007, 05:28:54 AM
I have a new problem now. :)
I have been using PIC16F628A uCs in the past. I want to start using PIC16F876As for the ADCs.

I have the velleman k8048 programmer, which supports these microcontrollers. I can't however, get it to program them.

It says that it is writing the HEX file (a simple blinking LED) but when its finished no LEDs blink. Also when i read back all of the data off the PIC, it is (nearly) all 3FFF values (1 or two are different in the first few lines). The HEX file has much different values. The code verification errors at the first value.

Any ideas?
Title: Re: Microcontroller power source problems
Post by: Admin on May 30, 2007, 06:47:44 AM
So this means its not actually getting programmed . . .

Ive never used the k8048 programmer, but with most (all?) programmers and compilers you must tell it which microcontroller you are using. If you change PICs but not the settings, it wont work.
Title: Re: Microcontroller power source problems
Post by: hazzer123 on May 30, 2007, 09:41:34 AM
Yeh i forgot to say. Although the website says there is compatability with the 876a, there is no option for it int the dropdown list. I have used 876 and 877 options, but none are successful.
Title: Re: Microcontroller power source problems
Post by: rgcustodio on May 30, 2007, 10:56:01 AM
Since you didn't mention it, do you have the latest S/W for the programmer? The latest version is 2.6.

http://www.vellemanusa.com/us/enu/download/files/
Title: Re: Microcontroller power source problems
Post by: hazzer123 on May 30, 2007, 11:11:56 AM
HAHA awesome thanks a lot.

The new software worked. I had been to that site, but only downloaded the old version for some reason... :)

Thanks