Re: Discovering PIC 16F18446 - TOGGLE "ASM WARNING - Invalid RAM location"
For week-ends hobbyist like me, is it better to stay with more "modest" PICs and/or always use workarounds like instead
it has nothing to do with with the pic chip at all. its simply incorrect usage of the pbp high level commands
Please, please don't answer "Easy! Just rfm!!!
did you even look at the link i suggested ? i don't know why i bother
all pbp "high level" commands that set a pin direction use a fixed offset to get to the tris reg
it simply will not work correctly from a LATx offset [serout , serout2, toggle,high,low,i2cread........................... ....... ie all of them
PORTx + offset always equals the TRISx register, LATx + offset does not equal the TRISx register ever
if you don't believe my then look at the lst file generated by your code
Code:
TOGGLE LATB.6
PAUSE 500
is improper use
Code:
TOGGLE PORTB.6
PAUSE 500
is proper use
Code:
LATB.6 = 1
PAUSE 500
LATB.6 = 0
PAUSE 500
is proper use
Code:
latb.6=!latb.6
PAUSE 500
is proper use
Warning I'm not a teacher
Bookmarks