These "enhanced" pics don't use the GPIO like the old ones. Use porta.5 to read
and lata.5 to write. See page 13 and page 121 of the data sheet
Add: See Hecklers code and configs
http://www.picbasic.co.uk/forum/show...ght=pic12f1822
These "enhanced" pics don't use the GPIO like the old ones. Use porta.5 to read
and lata.5 to write. See page 13 and page 121 of the data sheet
Add: See Hecklers code and configs
http://www.picbasic.co.uk/forum/show...ght=pic12f1822
Last edited by mark_s; - 30th October 2014 at 19:19.
Wow. Thanks Mark - I missed that. I just HATE all these whiz bang "features" that force us mere mortal coders to spend *days* learning a new chip! Grrrr. <end rant>
SO to implement a pin as output only I use:
GreenLED var lata.1 ' high = light power LED
and also set:
' config
TRISa = %011001 ' set I/O directions (0 = output, 1 = input)
LATa = %011001
- still not getting it to work with above settings. Do I have bit polarity right for LATA?
"Do or do not, there is no try" Yoda
I think you would declare your variable as
GreenLED var PORTA.1
At this point without posting your complete code it's hard to guess what's wrong.
Got all the OUTPUTS working fine - no need for LATA configurations apparently. Struggling with some kind of hardware bug - so I'm basically good. No idea how or why I would configure LATA at this point as it all seems to work fine without any direct reference to it.
"Do or do not, there is no try" Yoda
Bookmarks