I am trying to light a LED with a PIC10F206, a PICkit4, the IDE MPLAB X IDE v5.40, and the pic-as Assembler.
This is what I tried:
#include <xc.inc>
CONFIG CP=OFF
CONFIG MCLRE=OFF
ORG 0x0000
INIT:
MOVLW 0010B ;make GP1 an output pin
MOVWF TRISGPIO ;move content of working reg to TRISGPIO (this is the first error)
MOVLW 1101B ;set GP1 output low so that the LED with pullup res. lights up
MOVWF GPIO ;move working reg to GPIO
LOOP:
GOTO LOOP ;loop forever
END ;needed to end the program
The output is:
error: (800) undefined symbol "TRISGPIO"
I am trying to make GP1 an output pin and set the output of GP1 to 0 because I have the positive power supply on the other side of the LED.
According to the datasheet on page 21 TRISGPIO is a register.
And according to what I read online it is responsible for deciding if a pin is input or output.
So I put the bits 0010B in the working register. (so that GP0 is input, GP1 is output, GP2 is input, GP3 is input)
And then tried to put them into TRISGPIO.
I spent some hours digging through the microchip documentation but it's not really understandable for a beginner and tutorials are no longer valid.
trying to light a LED
, you are trying to compile code ... what the code is supposed to do is irrelevant to the error you are seeing \$\endgroup\$