Things I've Learned Working With Embedded Systems


nathanieltroutman - Posted on 23 April 2009

So here will be a collection of things I've learned while working on an embedded system, so far just wiring it up and testing the chip. For those interested I'm using an ATMEGA8-16PI.

  1. LEDs do have polarity, and if you get it wrong they don't flash, and it dosn't mean your code is wrong.
  2. The logical or "||" and the bitwise or "|" do NOT mean the same thing and writing: DDRB = 0x1 || 0x2 || 0x4 will not enable ports 1, 2, and 3, but only port 1, since 0x1 || 0x2 || 0x4 == 1. This makes you think the ports are bad, when really you wanted  0x1 | 0x2 | 0x4.

Post new comment

The content of this field is kept private and will not be shown publicly.