Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

AVR Tools GCC compiler help?

Status
Not open for further replies.

HarveyH42

Banned
I found this TV-B-Gone project I want to build, but the source is in C, an uses the GCC compiler. https://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.
 
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?
 
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.
 
Sceadwian said:
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 said:
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).
 
You could also just hit printscreen and show a screen capture.
 
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...
 
ssylee said:
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.
 
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.
 
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.
 
It works!!! :) At least on my TV. Going to bring it to work tomorrow and try the breakroom, the Walmart... :D

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.
 

Attachments

  • PIC04.jpg
    PIC04.jpg
    78.7 KB · Views: 250
  • PIC05.jpg
    PIC05.jpg
    97.4 KB · Views: 230
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top