Seven segment _2digit_cathode For Basic PRO Compiler




@ device pic16f877
define osc 4
define adc_bits 8
adcon1 = 7
trisa = $ff
trise = $00
trisc = $00
trisd = $00

digit   var     byte 
num     var     byte
disp    var     byte
 num =00
loop:  
      digit = num dig 0
      lookup digit,[$3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f],disp
      portd = disp
      high porte.0 
      pause 5   
      low porte.0 

     digit = num dig 1
       lookup digit,[$3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f],disp
       portd = disp
      high porte.1 
      pause 5   
      low porte.1 

       if(num>99) then 
         num=0 
      else 
       num =num+1  
      endif
      pause 200                                                             
     goto loop
end




Leave a Comment

*
= 5 + 7

Read previous post:
‘Bending current’ opens up the way for a new type of magnetic memory

A magnetic bit is being switched by bending electrons with the correct spin upwards through the bit. A special anti-ferromagnetic...

Close
Scroll to top