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.

pic16f628a

Status
Not open for further replies.

rakhiwilliams

New Member
hi,
i am doing project on pic16f628a.in this i hav to use two seven segment leds of type common anode,3 switches(one is for incrementing number,second for writing to EEPROM and the third switch to get the requiring delay).
i hav connected seven segments of LED to PORTB(RB0-RB7).To glow each segment i hav to give zero voltage(GND) to portpins.
my problem is i am not getting low voltage at RB0.Only this pin is not getting low.its taking continuous high voltage.i am giving the direction as output only.another thing is i am disabling the external interrupts also(which is the alternate function of RB0 pin).
i am setting configuration bits as follows.

_CONFIG_CP_ON&_DATA_CP_ON&_LVP_OFF&_BOREN_OFF&_MCLRE_OFF&_PWRTE_ON&_INTOSC_OSC_NOCLKOUT

i dont know whether RB0 is effecting by these settings .are there any bits which effects RB0?
thank you
 
Hello rakhiwilliams....I have had many strange problems caused by
configuration bits being set incorrectly in pic type 16F88....I am not that familiar with type 16F628A......Do you want code protection bit set???...because in your code above....you have it set.
Do you want this??
I would also turn WDT bit off.
Hope I have helped you a little bit.....Art
 
Last edited:
we changed configuration bits as follows
code protection off.and watch dog timer disabled.
though we are not getting low voltage on RB0 PIN
 
hi ,
i have another question .please give me the clues for this also.
how to calculate delay in this pic controller.i have to use 20msec delay and 0.1sec delay in my project.here i am using timer1 and i have to reload it with these delays at different situations.is there any equation to calculate these delays.i am using prescaling also(8).i used same delay equation as in 8051.but i am not getting correct delay.plz help me for this.
thanks in advance.
 
rakhiwilliams said:
hi ,
i have another question .please give me the clues for this also.
how to calculate delay in this pic controller.i have to use 20msec delay and 0.1sec delay in my project.here i am using timer1 and i have to reload it with these delays at different situations.is there any equation to calculate these delays.i am using prescaling also(8).i used same delay equation as in 8051.but i am not getting correct delay.plz help me for this.
thanks in advance.

If you're simply polling for the timer flag, you may as well just use software loops! - the PICList has a delay code generator which will generate the complete code for you.

If you're not polling, but using interrupts, use a fixed timer and count the number of interrupts - for your times, a 20mS delay would work well.
 
On the first problem, are you sure that the high (sic) voltage is coming from the PIC and not how you wired your 7 seg display? I would simply disconnect the 7seg display and see if you get the correct voltage. I bet you will.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top