optimization of while(!(PINA & 0x40)); Sorry for the slow response. Just found a key to the puzzle a few seconds ago. It appears to be the c++ compiler only.
Here's how to reproduce it. First make tst.c:
#include...

Thursday, 15 September 2005 - 00:11

optimization of while(!(PINA & 0x40)); Thanks for the response..
note that I said that the value 0x80 optimizes correctly, and the value 0x40 does not.
But just to be on the safe side, I tried your suggestion, and...

Saturday, 10 September 2005 - 08:39

Displaying ADC as voltage(math) Hello.
Thanks for the tip MegaUSBFreak. I just noticed the '1 bit' comment in the ATMega16 specs last night and was wondering about it :)..
Shadowbane

Monday, 30 August 2004 - 20:41

Displaying ADC as voltage(math) Oh ya, one more thing. If you use my little math trick, you need to be aware that your dividing by 256. If you read the maximum (8bit) value from the adc, it'll be 255. So the...

Laser Challenge Mouser's prices seem fairly competitive. They sell some things piecemeal, while others you must buy in quantity. I keep looking at something, getting excited over its price,...

Sunday, 29 August 2004 - 18:23

Displaying ADC as voltage(math) Guess I should mention that I assumed that the equation to be solved is:
Vin = (ADC * Vref) / 256.

Sunday, 29 August 2004 - 02:48

Displaying ADC as voltage(math) Hello,
BTW, an 8 bit number has 256 possible values, not 255 (dont forget the 0).
Shifting a number right one place is the same as dividing it by 2.
Shifting a number right two...

Sunday, 29 August 2004 - 02:38

Laser Challenge hello abcminiuser,
Just a thought on your internet purchasing problems. You can phone order from Mouser. They are just about like any other large old mail order company. They'...

Sorry for the slow response. Just found a key to the puzzle a few seconds ago. It appears to be the c++ compiler only. Here's how to reproduce it. First make tst.c: #include...

Thanks for the response.. note that I said that the value 0x80 optimizes correctly, and the value 0x40 does not. But just to be on the safe side, I tried your suggestion, and...

Hello. Thanks for the tip MegaUSBFreak. I just noticed the '1 bit' comment in the ATMega16 specs last night and was wondering about it :).. Shadowbane

Oh ya, one more thing. If you use my little math trick, you need to be aware that your dividing by 256. If you read the maximum (8bit) value from the adc, it'll be 255. So the...

Thanks for the responses. Makes sense.

Mouser's prices seem fairly competitive. They sell some things piecemeal, while others you must buy in quantity. I keep looking at something, getting excited over its price,...

Guess I should mention that I assumed that the equation to be solved is: Vin = (ADC * Vref) / 256.

Hello, BTW, an 8 bit number has 256 possible values, not 255 (dont forget the 0). Shifting a number right one place is the same as dividing it by 2. Shifting a number right two...

hello abcminiuser, Just a thought on your internet purchasing problems. You can phone order from Mouser. They are just about like any other large old mail order company. They'...