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.

pic 16f628a problem

Status
Not open for further replies.

normad

Member
hey im using hitech c to run a simple program on the 16f628a.. i set my tris a register to 0x00 and set a pin to be high (RA1 = 1) but still the output is something around .5 volts.. any idea on what could be wrong.. i have supplied 5V to Vcc and MCLR and MCLR is enabled..
 
it was set to xt cause i used a 4Mhz crystal.. but now i just changed it to INTIO just to see if its something wrong with the clock and my outputs work now :) but id still like to use the external clock.. is there a polarity in the crystal? my program needs to measure time.. how accurate is the internal clock?
 
it was set to xt cause i used a 4Mhz crystal.. but now i just changed it to INTIO just to see if its something wrong with the clock and my outputs work now :) but id still like to use the external clock.. is there a polarity in the crystal? my program needs to measure time.. how accurate is the internal clock?

Did you have the correct capacitors connected to the crystal?, you need a crystal if you're measuring time.
 
yups i used two 20pF caps.. so the crystal doesnt have polarity? maybe its something with my circuit.. ill check it again.. is there any way to test the crystal?
 
Hi,

Are you using a breadboard for your construction ? - using crystals in them is a known problem.
 
nopes.. im using a pcb.. but the track for my crystal kinda came off in the process of soldering (noob mistake :$) so i did a bit more of soldering to fix that and i think thats the problem.. :) i think ill fix that first and try again :) is there anyway to check the crystal is working? so that i can be sure before running the program
 
nopes.. im using a pcb.. but the track for my crystal kinda came off in the process of soldering (noob mistake :$) so i did a bit more of soldering to fix that and i think thats the problem.. :) i think ill fix that first and try again :) is there anyway to check the crystal is working? so that i can be sure before running the program

If you have a scope, you can check if it's oscillating, but you must use a x10 probe or the scope may stop it running anyway.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top