Some PIC may have ADCs or else fancy multiplexed stuff on this port. You want to make sure they're disabled first, unless you will have some erratic results.
I usually use something a little bit different
Code:
PORTC21Value=PORTC & 3
IF PORTC21 =1 then ...
if PORTC21=2 then ...
IF PORTC21=3 then ...
This read the whole PORT in oneshot and may override some RMW issue.
Make sure you have any kind of pull-up / down resistor in case you're reading PushButtons
<hr>
There's nothing bad with PicFlash. You need to set your config fuses in your code and when you import the .HEX file, it will import/change the Config Fuses for you.
You can lauch PICFlash in MCS. You need to add a programmer in the list. View>>Compile and program option>> programmer and folllow the instructions.
I use the following parameters line
Code:
-pPIC$target-device$ -f$hex-filename$ -e -w
HTH
Last edited by mister_e; - 9th April 2008 at 17:18.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks