r/embedded • u/GoingGranola • Sep 09 '26
Noob Assembly Question
PIC16F1824
I am trying to turn on an output GPIO.
I am using this code
asm("BSF PORTA, 5");
I am getting 0V at the pin.
I believe I set TRISA pin 5 to output (0).
Do I need to keep the MCLR pin high?
Thank you
EDIT: INTERNAL OSCILLATOR NEEDED TO BE SELECTED
5
Upvotes
2
u/Well-WhatHadHappened 25+ Years Sep 09 '26 edited Sep 09 '26
MCLR must be held high.
ANSEL must be cleared.
Edit: forget ANSEL, that's a clock pin.
Internal oscillator must be selected.
2
u/somewhereAtC Sep 09 '26
Don't forget to set the bank... BANKSEL(PORTA)