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.

PIC16F877A count function

Status
Not open for further replies.

aladdin83

New Member
Hi all,

I am using PIC16F877A ucontroller to control a cart. The PWM pins are both used to drive the dc motors I have on the cart. I read in the manual that I can use a count function on other pins.

I tried to use the function with Port B pin 7 and display the result on LCD
The LCD works fine, I can display the A/D result and other text

when using the count function the code is COUNT PIN, PERIOD IN us, var
its suppose to count how many times the the pin goes TRUE/FALSE in a period of time and store the value in a variable

the LCD always show 1 as the result.

I tried to move the count function outside the main program loop and nothing happend..

did anyone use this function beofre? any suggestions?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top