SwingeyP
Member
apart from 8 bits - byte and all that I have to admit that I am still a little cold on this subject of .hb and .lb
Can anyone help me with this please.
I am editing the example for the 7SEG display. I want to read a code from PORT D on 16F877A.
It could be 01111101 = 0x7d- Great I thought. So now lets look at the .hb and the .lb
.hb = 0111 .lb = 1101 right?
SO whay can't I do this ....
Dim digit As Byte 'input variable for GETMASK subroutine
Dim digit1 As Byte 'current high digit
Dim digit2 As Byte 'current low digit
blah, blah , blah - as per example
and then this .....
loop:
For i = 0 To 99
digit1 = PORTD.LB 'get lowbyte
digit2 = PORTD.HB 'get highbyte
TMR0 = 0 'reset Timer0 to prevent its interrupt before both masks are determined
digit = digit1
Gosub getmask 'get mask for high digit
mask1 = mask
digit = digit2
Gosub getmask 'get mask for low digit
mask2 = mask
Gosub show1 'display new mask
Gosub show2 'display new mask
WaitUs 500 'delay interval suitable for simulation
'use large delay for the real device, say WAITMS 500
Next i
Goto loop
End
Hmm something needs to be a word here I think.
I am trying to read the .lb and .hb to drive two 7 seg displays that will display whats is on the DPORT. not really bothered about the other code (timer etc) I was just editing the example.
Regards - Paul
Can anyone help me with this please.
I am editing the example for the 7SEG display. I want to read a code from PORT D on 16F877A.
It could be 01111101 = 0x7d- Great I thought. So now lets look at the .hb and the .lb
.hb = 0111 .lb = 1101 right?
SO whay can't I do this ....
Dim digit As Byte 'input variable for GETMASK subroutine
Dim digit1 As Byte 'current high digit
Dim digit2 As Byte 'current low digit
blah, blah , blah - as per example
and then this .....
loop:
For i = 0 To 99
digit1 = PORTD.LB 'get lowbyte
digit2 = PORTD.HB 'get highbyte
TMR0 = 0 'reset Timer0 to prevent its interrupt before both masks are determined
digit = digit1
Gosub getmask 'get mask for high digit
mask1 = mask
digit = digit2
Gosub getmask 'get mask for low digit
mask2 = mask
Gosub show1 'display new mask
Gosub show2 'display new mask
WaitUs 500 'delay interval suitable for simulation
'use large delay for the real device, say WAITMS 500
Next i
Goto loop
End
Hmm something needs to be a word here I think.
I am trying to read the .lb and .hb to drive two 7 seg displays that will display whats is on the DPORT. not really bothered about the other code (timer etc) I was just editing the example.
Regards - Paul