hello guys
m new here in this forum and i want an urgent help
m having a project for EEG and i want to use a 16f877a microcontroller
my aim is to detect the analog eeg signal on the portA of the pic. once this signal is detected by pic i want the portb.0 to give 1.
i dont need to calculate any frequency just to detect the presence of the signal
i tried the following program:
Device 16F877A
XTAL = 4
Output PORTB.0
ADCON1 = %00001110
While 1 = 1
If PORTA.0 = 1 Then
PORTB.0 = 1
Else
PORTB.0 = 0
EndIf
Wend
End
plz can anyone check if i have any error in this program knowing that the simulation of this program on PROTUES is not giving the desired result
thnx for any help
m new here in this forum and i want an urgent help
m having a project for EEG and i want to use a 16f877a microcontroller
my aim is to detect the analog eeg signal on the portA of the pic. once this signal is detected by pic i want the portb.0 to give 1.
i dont need to calculate any frequency just to detect the presence of the signal
i tried the following program:
Device 16F877A
XTAL = 4
Output PORTB.0
ADCON1 = %00001110
While 1 = 1
If PORTA.0 = 1 Then
PORTB.0 = 1
Else
PORTB.0 = 0
EndIf
Wend
End
plz can anyone check if i have any error in this program knowing that the simulation of this program on PROTUES is not giving the desired result
thnx for any help