View Single Post
Old 05-19-2008, 05:58 PM   #6 (permalink)
JohnnyGrey
Master EcoModder
 
Join Date: Apr 2008
Location: Earth
Posts: 303

Pushrod - '02 Chevrolet Cavalier
Thanks: 0
Thanked 8 Times in 4 Posts
Quote:
Yes, you are right on all counts. But, I do not know how to write computer code and I also do not want any expense such as buying micro controllers, displays or dedicated laptop computers or PDAs.
Honestly, AVR development is quite cheap. I develop for two chips primarily, the Tiny2313 and the Mega162. The former costs about $2.50 and the latter, about $4. I program them with a parallel port cable I built for under $10 from radioshack parts. You sound like you're good with electronics and have a decent EE background. If you can solder, understand a datasheet, convert between binary, hex and decimal, you can probably program AVR in assembler.

Assembler isn't as hard as people make it out to be. You've got a very limited amount of instructions with a very simple syntax. In fact, I have fewer syntax errors in assembly than I do in C because it's so simple. The difficulty in assembly comes from the fact that you must explicitly tell the device what to do, and how to create complex functions with simple commands. For example, you might have to write your own multiplication or division routine.

Where in C you can say a = b+3; the equivalent AVR code would look like
Quote:
.EQU A=0x0100 ;Set an alias for the location of A in RAM (for readability purposes)
.EQU B=0x0101 ;Set an alias for the location of B in RAM

LDS R16, B ;Load B into register 16
LDI R17, 3 ;Load 3 into register 17
ADD R16, R17 ;Add register 17 (3) onto register 16 (B) and store in register 16
STS A, R16 ;Store the result (register 16) into the A's RAM location
So you see, it's not terribly difficult, and if you can understand op-amps and read a datasheet, you can surely wrap your mind around this. Development is very cheap and if you already have a computer, no dedicated hardware is needed. I use my bedroom workstation for development. Check youtube for "AVR Project" for some cool ideas. Tell me this isn't crazy:

  Reply With Quote