How do you get pins to be digital Im having a problem with maybe PORTC.2 or PORTA.6
I have a 8x8 leds on porta rows and portc cols I was testing some code and I can turn off all the leds but when I toggle just one led the led at portc.2 and porta.6
comes on while the led i toggle is off
18f25K22
Moderators: David Barker, Jerry Messina
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: 18f25K22
Try SetAllDigital() in the updated module http://www.sfcompiler.co.uk/wiki/pmwiki ... tDigitalIO
If that doesn't fix the problem it may be a RMW issue. In that case read the LAT instead of the PORT register.
If that doesn't fix the problem it may be a RMW issue. In that case read the LAT instead of the PORT register.
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: 18f25K22
... or it might be the slew rate control.
The K22 defaults to slow mode which is about 1/10 the normal speed. This can make RMW effects even worse than normal.
The newer versions of SetDigitalIO take care of this for you too.
The K22 defaults to slow mode which is about 1/10 the normal speed. This can make RMW effects even worse than normal.
The newer versions of SetDigitalIO take care of this for you too.
Re: 18f25K22
I got it figured out I used the LATC and wrote a whole port that fixed it
-
- Swordfish Developer
- Posts: 1473
- Joined: Fri Jan 30, 2009 6:27 pm
- Location: US
Re: 18f25K22
If using the LAT fixed it then it's pretty much likely a RMW problem (you should be able to set/clear individual bits in the LAT without worrying about RMW).
If you're not using the latest version of SetAllDigital you could also try addingwhich should set the pins to normal slew rate. If you leave SLRCON set to its default the port pins are really slow to transition and that makes it worse.
If you're not using the latest version of SetAllDigital you could also try adding
Code: Select all
SLRCON = 0