Archive for code

Porting AVR code for MSP430 chips

Posted in AVR, msp430 with tags , , , , , on August 12, 2010 by Mike Szczys

I’ve just finished my first port of code from AVR over to MSP430. I used the garage door code button source because it’s fresh on my mind and I can reproduce the hardware on the TI Launchpad board. This provided a few sets of challenges, and showed me what I can do from the start to make my code more portable. I’ll get into both of those subjects and share the ported code after the break. Continue reading

Translating easy board design into easy code.

Posted in AVR, Programming with tags , , , on August 16, 2009 by Mike Szczys

7-segment_finishedI’ve been working with some 7 segment displays lately.  I found an old computer on the side of the road and pulled a 3-digit display out of it.  The hundreds digit can only display a 1 and it has no decimal points.  After pulling it off of the board I find that it is a 16-pin module; one pin is common anode, one pin is the cathode for both segments of the hundreds digit, and the other 14 pins are cathode pins for one segment each.

I did some breadboarding with this module and was able to get things working pretty easily.  When I decided to do some PCB design things became more complicated.  For ease of programming I had connected all of the segments of the ones digit to PortD of an ATtiny2313.  I then connected all of the segments of the tens digit as well as the single pin for hundreds to PortB.  This setup makes for easy coding as each number you want to display can be stored as an 8-bit char and written directly the the Port for the corresponding digit.  The problem is that the board design to match this is not at all easy. Continue reading