Hello,
I have a trouble with ADC setup for PIC18F27Q43.
Here is my code,
#Chip 18f27q43,16 #config LVP = ON #config MCLR = ON #define USART_BAUD_RATE 9600 #define USART_TX_BLOCKING #define USART_DELAY OFF RC4PPS = 0x20 ; RC4 -> TX ; ADC setup #define AD_REF_SOURCE AD_REF_AREF #define ADSpeed LowSpeed dir portb.7 in Do hserprint readad12(anb7) HSerPrintCRLF wait 1 s Loop
I expect that PREF bits in ADREF resister should be set to 0b10. However, I cannot see any ADREF resister operation in the resultant .asm file (attached).
Am I doing something wrong? or, a bug of GCBasic?
Thanks
Can you check the Q43 demos. Do those ADC demos work?
I want to ensure the basics works before we look at the ASM.
Evan
Do you mean https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources ?
However, I can only find one code which uses AD_REF_SOURCE, https://github.com/search?q=repo%3AAnobium%2FGreat-Cow-BASIC-Demonstration-Sources%20%20AD_REF_SOURCE&type=code
And the code is for LGT8F328P.
Thus, I cannot check. I myself have already done some tests, blinking LED, serial sending, LCD, and ADC without any #DEFINE setups.
I meant the basic ADC demos, but, I think you need to use FVRInitialize(). See the Help.
FVR? ADC basic demo? Since I am new to GCBasic and then many things are unknown for me.
I have just added them manually to make things working,
ADREF.PREF0 = 0 ADREF.PREF1 = 1
Thanks,
Log in to post a comment.
Hello,
I have a trouble with ADC setup for PIC18F27Q43.
Here is my code,
I expect that PREF bits in ADREF resister should be set to 0b10. However, I cannot see any ADREF resister operation in the resultant .asm file (attached).
Am I doing something wrong? or, a bug of GCBasic?
Thanks
Can you check the Q43 demos. Do those ADC demos work?
I want to ensure the basics works before we look at the ASM.
Evan
Do you mean https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources ?
However, I can only find one code which uses AD_REF_SOURCE,
https://github.com/search?q=repo%3AAnobium%2FGreat-Cow-BASIC-Demonstration-Sources%20%20AD_REF_SOURCE&type=code
And the code is for LGT8F328P.
Thus, I cannot check. I myself have already done some tests, blinking LED, serial sending, LCD, and ADC without any #DEFINE setups.
I meant the basic ADC demos, but, I think you need to use FVRInitialize(). See the Help.
Evan
FVR? ADC basic demo?
Since I am new to GCBasic and then many things are unknown for me.
I have just added them manually to make things working,
Thanks,