Proszę o pomoc w wyjaśnieniu jak wyświetlić na LCD wartość odczytaną komendą getADC. oto kod programu:
Config Adc = Single , Prescaler = Auto
'Now give power to the chip
On Adc Adc_isr Nosave
Enable Adc
Enable Interrupts
Dim W As Word , Channel As Byte
Channel = 7
'now read A/D value from channel 0
Do
Channel = 7
'idle will put the micro into sleep.
'an interrupt will wake the micro.
Start Adc
Idle
Stop Adc
Cls
Locate 1 , 1
Lcd "Channel " ; Channel ;
Locate 2 , 1
Lcd " value " ; W
Waitms 250
Loop
End
Adc_isr:
push r24
in r24,sreg
push r24
push r25
W = Getadc(channel)
pop r25
pop r24
!out sreg,r24
pop r24
Return
niestety komendą LCD nie można wyswietlać zmiennej typu Word. Jak obejść ten problem?, jak wartość odczytana komendą getADC ma się do wartości napięcia mierzonego na nodze procesora?
z góry dziękuję za pomoc
Config Adc = Single , Prescaler = Auto
'Now give power to the chip
On Adc Adc_isr Nosave
Enable Adc
Enable Interrupts
Dim W As Word , Channel As Byte
Channel = 7
'now read A/D value from channel 0
Do
Channel = 7
'idle will put the micro into sleep.
'an interrupt will wake the micro.
Start Adc
Idle
Stop Adc
Cls
Locate 1 , 1
Lcd "Channel " ; Channel ;
Locate 2 , 1
Lcd " value " ; W
Waitms 250
Loop
End
Adc_isr:
push r24
in r24,sreg
push r24
push r25
W = Getadc(channel)
pop r25
pop r24
!out sreg,r24
pop r24
Return
niestety komendą LCD nie można wyswietlać zmiennej typu Word. Jak obejść ten problem?, jak wartość odczytana komendą getADC ma się do wartości napięcia mierzonego na nodze procesora?
z góry dziękuję za pomoc