• Modifying a specific bit in a register
    Hello Everyone. It is so great to be with all MCU lovers at the same place .. I have just migrated from PIC mcus to STMs and I am quite excited with all these new stuff coming up every day ,...
  • Assigning a larger value to a bit
    bit bitVal; unsigned char byteVal; : : bitVal = byteVal; Question: How does C51 determine whether to set or clear the bit? Does it: A). Simply copy the LSB of the byteVal into the bit, or B)...
  • Bit-addressable register
    Hi all, When I do this: P7_SFR DEFR 0FFD0H DP7_SFR DEFR 0FFD2H HWWDOG_PORT EQU P7_SFR HWWDOG_DIRPORT EQU DP7_SFR HWWDOG_BIT EQU 6 HWWDOG_PULSEBIT DEFB HWWDOG_PORT.HWWDOG_BIT ; P7, bit 6 I...
  • Writing to non addressable bits
    Hi, I am trying to get to grips with the Keil C compiler. I understand that not all SFR's are bit addressable, if not evenly divisible by 0 or 8 - a pain if you ask me! - you can tell i am new to this...
  • C51: 32 bits unsigned returned values treated as signed 16 bits
    Hi! In a full project a simple unsigned long ( u32 )returned value from a function lead to this (odd) assembler code. It make us think that the u32 is considered as s16 ( signed short ). If...