Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

8 bit binary from port d (16f877a) and display it to 7 segment

Status
Not open for further replies.

lockman_akim

Advanced Member level 1
Joined
Jul 12, 2010
Messages
466
Helped
76
Reputation
152
Reaction score
68
Trophy points
1,308
Location
Malaysia
Activity points
3,523
i already program my pic to let the port d value equal to my my adc input..my program is like this...

(i use basic)

adraw = adin 0
portd = (adraw/4)

so my problem is how to display the 8 bit binary to three 7 segment...
i know 7 segment have decoder.. but i think i cant use it directly..
anyone have idea?
 

I don't know which compiler you use, but in mikroBASIC, it would be something like:

ADR = ADC_Read(0) >> 2 '>>2 is more efficient than /4
a[0] = ADR div 100
a[1] = (ADR div 10) mod 10
a[2] = ADR mod 10

Now send a[0],a[1],a[2] to PORT of 7 segment and alter the 7 segment power as required.

Hope this helps.
Tahmid.

PS. you should post in the forums, where you're more likely to get more help.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top