How to count bit high and low

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
diyadel
Posts: 5
Joined: 08 Dec 2019 21:42

How to count bit high and low

#1 Post by diyadel » 09 Dec 2019 10:09

Hello
How can i count the number of bits high in the port

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: How to count bit high and low

#2 Post by hexreader » 09 Dec 2019 10:42

Which language? (C, BASIC, PASCAL)

Which PIC?
Start every day with a smile...... (get it over with) :)

diyadel
Posts: 5
Joined: 08 Dec 2019 21:42

Re: How to count bit high and low

#3 Post by diyadel » 09 Dec 2019 19:59

C language

For three pics
Pic16f886
Pic16f887
Pic16f628a

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: How to count bit high and low

#4 Post by hexreader » 09 Dec 2019 20:04

Working on examples for this and your other post - PIC16F887

Will be ready soon - probably
Start every day with a smile...... (get it over with) :)

hexreader
Posts: 1786
Joined: 27 Jun 2010 12:07
Location: England

Re: How to count bit high and low

#5 Post by hexreader » 09 Dec 2019 20:24

Bit counting example for PIC16F887 attached.

Be sure to provide pull-down resistors on all PORT B inputs
Attachments
forum.zip
(19.9 KiB) Downloaded 80 times
Start every day with a smile...... (get it over with) :)

Post Reply

Return to “PIC PRO Compilers”