Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16f872 does not run correct after programming...

Status
Not open for further replies.

Spock540

New Member
Hello at first i am very new to this kind and maybe its a stpid question but i cant figure out. I build a board with a PIC16f872 where it is possible to programm the chip with. The programming is fine i compared too HEX files from different locations so i am sure the program reaches the Chip..... but when i write a testprogram like SET_TRIS_B (0x0f) in a while(1) loop the chip does not toggle those pins they are low all???? I can not get any program to run on that "animal".... Any suggestions or help is appreciated.

Thanks

Spock540

[/code]
 
Setting the tris will make those pins inputs, so they will be 'low' when measured.

You should clear the tris for the pins (make it '0') and then in your loop write '1' to the port (not the tris) delay (important, pic runs to fast to see anyting happen without delay) and then write '0' to the port.

If your sure your software is correct and it doesn't run then there may be a oscillator problem. What oscillator are you using and how fast is it?
common problems are :
No oscillator :roll:
wrong config fuses (0-4Mhz XT, 4MHZ+ HS)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top