Author Topic: Using BitData Types and Variables in PIC18F using Hi-tech Compiler 9.51(PICC-18)  (Read 819 times)

0 Members and 1 Guest are viewing this topic.

Offline tarun172Topic starter

  • Regular Contributor
  • *
  • Posts: 63
  • Country: us
All,
     I was handed over an old code makes use of bit data types, registers and bit variables. This code base makes extensive use of bit variables. Recently, I came across a suspected bug in this code base. I traced this issue back to one of the bits in register. The bit sets (instead of clearing) upon power cycle causing this issue to occur. At-least, that what I am suspecting. It is pretty repeatable across other devices, old and new. I am using standard hi-tech compiler version 9.50. Reading through user manual, section 3.4.2 and 3.4.3, I am not able to find exact root cause. Why that particular bit? Why only in power up?Is there a particular way of handling these registers and bit during code compilation? Do you normally specify a memory location during compilation?

Regards,
Tarun S
Thanks & Regards,
Tarun S
 

Offline Bruce Abbott

  • Frequent Contributor
  • **
  • Posts: 627
  • Country: nz
    • Bruce Abbott's R/C Models and Electronics
I am using standard hi-tech compiler version 9.50.
In the thread title you say 9.51. Which is it?

Quote
The bit sets (instead of clearing) upon power cycle causing this issue to occur. At-least, that what I am suspecting.
Why do you suspect this?

Quote
Reading through user manual, section 3.4.2 and 3.4.3, I am not able to find exact root cause. Why that particular bit? Why only in power up?
Which bit? Can you show us the code that sets/clears it?

Quote
Is there a particular way of handling these registers and bit during code compilation? Do you normally specify a memory location during compilation?
The hardware bits are defined in the header file of the selected MCU, so you should not have to specify their memory locations.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf