Note that there are some explanatory texts on larger screens.

plurals
  1. USJubatian
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COWrapping in macros is the way how it should work I think. The problem with the current approach is inconsistency (like `GIFR |= 1U << 6;` and `var = 6; ... GIFR |= 1U << var;` producing fundamentally different results), not to mention that how I can be sure that through optimization or various layers of indirections the expansion to `SBI` or `CBI` won't fail. So I would except these constructs resolving to R-M-W while having macros for the delicate stuff which have their well-known constraints and can be expected to work reliably.
      singulars
    2. COAn interesting effect which sure is visible if you try to clear interrupt flags (datasheet pg. 70). If you do one like `GIFR |= 1U << 6;` then it will "work" (only the intended flag will clear). However if you attempt to clear two like `GIFR |= (1U << 6) | (1U << 7);`, then all 3 will clear, and bang, you have a bug in there. From C level I would except these two behave similarly (either both clearing all flags due to R-M-W or both clearing only the flags I explicitly specified) however it is clearly not the case here.
      singulars
    3. COHe was trying to interface a parallel alphanumeric LCD. We had experience with these from earlier with PIC18s using C, I originally recommended him to just take one of those and port it. The LCD did not work (like if we did not communicate with it at all). Then looking in the problem and skimming through the ported code I concluded this, he did it, and the LCD worked as the code dictated. In the prev. code there were stuff like `PORTC |= (1U << 6) | (1U << 7);` which obviously won't translate to `SBI`, so true R-M-W happens, then see above. Datasheet does not define R from PORTx.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload