View previous topic :: View next topic |
Author |
Message |
Jody
Joined: 08 Sep 2006 Posts: 182
|
ouput_c(255) gives 215 on PORTC |
Posted: Wed Feb 11, 2009 7:20 am |
|
|
Hello,
When I write output_C(255) not all of the bit go to one (bit 3 and bit 5 remain 0). So the port show's 215.
What is going on here???
PIC 18F876A
Compiler:4.049...
It used to work and suddenly.... it goeas bananas...
Even with an other PIC the same result..
Any ideas??
Regards,
Jody |
|
|
Wayne_
Joined: 10 Oct 2007 Posts: 681
|
|
Posted: Wed Feb 11, 2009 7:33 am |
|
|
What else does pin C3 and C5 do on that pic ?
You most likely have enabled something which is controlling those pins. |
|
|
Jody
Joined: 08 Sep 2006 Posts: 182
|
|
Posted: Wed Feb 11, 2009 7:45 am |
|
|
I enabled the SPI interface....
Code: | setup_spi(SPI_MASTER|SPI_L_TO_H|SPI_CLK_DIV_4); |
Removing this did it...
Thanks for the assistance,
Jody |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed Feb 11, 2009 10:11 am |
|
|
It's the little things that can sneak up on you, like a tick, and bite you on the back-side. Big things, like a dog growling, you can easily keep away from. Funny how, when you figure it out, it makes perfect sense why it wasn't working when you thought you had it right before. Happens to all of us.
Ronald |
|
|
|