PDA

View Full Version : Operating a PIC at 3V ?



Scott
- 11th September 2005, 21:05
Everytime I start a project that requires a battery I spend way to much time getting the PIC to even run. The other components are powered up fine.

I would like to run my PIC16F876A at 3.0 or 3.3V. I would like to run the PIC at 4mhz. Will the PIC handle datarates of 9600 Baud on the UART pins?

I have my PIC in the circuit and have an LEd tied to PORTC.0 to make sure the PIC is running. IT does not Illuminate the LED. What should I be looking for?

Any help would be greatly appreciated,

mister_e
- 11th September 2005, 21:16
I would like to run my PIC16F876A at 3.0 or 3.3V. I would like to run the PIC at 4mhz. Will the PIC handle datarates of 9600 Baud on the UART pins?
Yes it will. Look the datasheet or use my SPBRG calc (http://www.picbasic.co.uk/forum/attachment.php?attachmentid=316). with the right settings, you can have a 0.16% error wich is really not as this bad.


I have my PIC in the circuit and have an LEd tied to PORTC.0 to make sure the PIC is running. IT does not Illuminate the LED. What should I be looking for?
Once again, i'll bet on the Brown-out detect fuse. Disable it and post your results.

Scott
- 11th September 2005, 21:26
Thanks Mister_E!

We have the PIC running! Brown out was the problem.

Now the data going over the UART is not correct. Here is some test code I am using:

' Setup Auto Epic Settings
@ device pic16F876A, hs_osc, wdt_off, pwrt_on, protect_off
DEFINE OSC 4 ' Set Xtal Frequency

' Setup Hardware for uart
DEFINE HSER_BAUD 9600
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 129
DEFINE HSER_CLROERR 1

pause 100
HSEROUT ["Startup", 13, 10]

main:
pause 5000
hserout ["Data Out.....", 13,10]
goto main

Thanks again,

mister_e
- 11th September 2005, 21:38
You didn't choose the right SPBRG value for your crystal... @ 4MHZ you should have...


DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 25 ' 9600 Bauds

Scott
- 11th September 2005, 21:44
It seems I need to go back and review the Microchip data sheets!

Thanks for all the help everything is working fine!

Scott
- 11th September 2005, 23:59
It seems I need to go back and review the Microchip data sheets!

Thanks for all the help everything is working fine!