Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 27th October 2007, 02:19 PM   (permalink)
Default AVR Tools GCC compiler help?

I found this TV-B-Gone project I want to build, but the source is in C, an uses the GCC compiler. http://www.ladyada.net/make/tvbgone/download.html

I don't know much about C, or how to use the compiler, but tried a few times to get it to build the hex file, but just get errors. So, basically have no idea what I'm doing. There are four files in the source ZIP.

So far, I've only programmed in assembly, so haven't had to learn about C or BASIC compilers, so I need a quick walk through the process of making a hex file from C. Or if you are feeling generous, just compile the hex for me (although I should learn this stuff sometime).

I'll have to order the Tiny85 (needs the 8k flash), and an 8 mhz crystal, so have about two weeks to get the program ready to burn. Also going to do my own PCB. Their's is in Eagle and two sided, also seems a little larger than needed. I want it a little smaller and descreet. I think the ISP header was the reason they went with a 2-sided board, it's an 8 pin chip, so a socket will be fine. The use 4 IR LEDs, but 2x60 degree should work just as well.
HarveyH42 is online now  
Old 27th October 2007, 05:14 PM   (permalink)
Default

I've never used the GCC compiler, I've only ever programmed AVR's in ASM, but I might be able to help if no one else can. What kind of errors are you getting?
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 27th October 2007, 05:17 PM   (permalink)
Default

Ordered the parts from Digikey, should be here next week sometime. Got enough for 4 (usually gadgets like this attack the build-me-one people).

I think I got the source complied, but won't be sure until I try to burn. I tried WinAVR, got a few errors (no idea what they mean, but didn't seem fatal). The hex file is 23k, which is huge compared to anything I've done before in assembly. The Tiny85 has 8k, so a little concerned if it'll fit. Don't know what all is in a hex file, thought it was straight binary program.

Need to get some PCBs ready, shouldn't take long.
HarveyH42 is online now  
Old 27th October 2007, 05:22 PM   (permalink)
Default

Quote:
Originally Posted by Sceadwian
I've never used the GCC compiler, I've only ever programmed AVR's in ASM, but I might be able to help if no one else can. What kind of errors are you getting?
Not sure about the errors, it's all new to me. I tried save as, but it just saved the make file, not the compile screen. Should have copy/paste into notepad before I closed it. Going to redo it, the hex file seems kind of big.
HarveyH42 is online now  
Old 27th October 2007, 09:14 PM   (permalink)
Default

Quote:
Originally Posted by HarveyH42
The hex file is 23k, which is huge compared to anything I've done before in assembly. The Tiny85 has 8k, so a little concerned if it'll fit. Don't know what all is in a hex file, thought it was straight binary program.
No idea on GCC or AVR, but a HEX file is a LOT larger than the binary file, it's an ASCII representation, with added address bytes, line counts, and checksums (plus spaces and CR/LF as well).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 27th October 2007, 10:58 PM   (permalink)
Default

You could also just hit printscreen and show a screen capture.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 28th October 2007, 12:20 AM   (permalink)
Default

I think it's okay. I loaded the hex file into AVR Studio, and it disassembled it. I couldn't simulate it, but the program looked like it might work. Have to read the docs someday. Can't rely on luck forever. Didn't even know you could disassemble a hex file.

Did a PCB (well 4 actually), but think this last one will be the one to etch. Not real happy about running traces between pins, but not as much as doing a double-sided board...
HarveyH42 is online now  
Old 28th October 2007, 12:24 AM   (permalink)
Default

Did you try asking on the Atmel support forums with the hex file problem that you have?
ssylee is offline  
Old 28th October 2007, 02:39 AM   (permalink)
Default

Quote:
Originally Posted by ssylee
Did you try asking on the Atmel support forums with the hex file problem that you have?
Didn't think was something to pester them about. It was my first C compile ever. I'll wait for the chips and see if it programs. It's nothing too serious or critical, more of a hobby gadget and a learning experience. I brought it here, because it might be a useful experience for other members.
Considering the price people pay for these gadgets, and the cost to build this one, seemed like something other people might build. There have been several threads in the past, asking about long-range TV gadgets. This one claims over 100 ft (30m). I didn't check the kit price, I have everything except the Tiny85 ($2.77) and resonator.
HarveyH42 is online now  
Old 28th October 2007, 02:47 AM   (permalink)
Default

Files converted to ASM from raw binary are often horribly unreadable becaus ethe label register and variable names don't stick. With C programs some extra debug information can be stored but it's not usual.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 3rd November 2007, 09:41 PM   (permalink)
Default

Well, got the PCB etched, drill, and stuffed this morning. Digikey and UPS expect delivery on monday. With any luck, UPS will leave the package at the door if I have to work late. Just need to solder in the resonator and program the chip.
HarveyH42 is online now  
Old 5th November 2007, 11:17 PM   (permalink)
Default

It works!!! At least on my TV. Going to bring it to work tomorrow and try the breakroom, the Walmart...

Yeah, got a little carried away with the hot glue. Didn't have a case, a 2xAA battery holder. Thinking about doing another anyway. Going to loose the socket and lay the components flat, try a 3v lithium coin cell. Don't think the battery will last long, but think it'll be good enough to run through the codes a few times.

Not sure about the range, but works the entire length of my house. Sitting in the same room, don't even need to point at the TV. Pretty cool gadget for having to buy maybe $5 worth of parts.
Attached Images
File Type: jpg PIC04.jpg (78.7 KB, 15 views)
File Type: jpg PIC05.jpg (97.4 KB, 12 views)
HarveyH42 is online now  
Old 5th November 2007, 11:25 PM   (permalink)
Default

nice job minus the glue hehe
Twisted is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Good Electronic Supply's Sites, Everyone Come On In! :P Electric Rain General Electronics Chat 44 28th August 2007 12:06 AM
Development tools for ARM7 Halo Micro Controllers 2 12th April 2007 09:50 PM
Regarding the CCS Compiler 3v0 Micro Controllers 5 24th March 2007 10:22 PM
Help, CCS PIC-C Compiler... Kenton Micro Controllers 17 3rd April 2006 12:48 AM
Atmel AVR free compiler and support free forum mramos1 Micro Controllers 3 24th October 2005 09:00 AM



All times are GMT. The time now is 09:05 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker