Anyone for help programming Micro´s PCB ?!

Started by Nina, May 10, 2014, 06:47:00 AM

Previous topic - Next topic

Nina


I just receive his PCB kit and i was very satisfied with the results, but i want more range on my analog.
So i simply need to alter MAX e MIN values on the code that Micro release for us.
I spend a few hours  trying to understand how Attiny24 works and how i attach it to my USBASP ( http://www.ebay.com/itm/USBasp-USBISP-3-3V-5V-AVR-Programmer-USB-ATMEGA8-ATMEGA128-New-/130682846209?hash=item1e6d4dfc01 )
to alter the code.

But that was the problem. i learn that my USBASP has 10 wires MOSI, MISO, RESET, SCK, GND, VCC, NC, and 3 more GNDs,
i dont know where and how i can plug them on attiny24 cause its looks pretty hard to solder in a such a small pins from the microcontroller.
Anyone to help me on that please   :D??

And after that, witch programs i should use for development Bascom? ATMEL studio? what about avrdude?
Heeeeeelps!  :-[


abduct

You will most likely have to desolder the mcu and solder it onto a breakout board to easily reprogram it. I don't think he included any test pads or breakout for reprogramming, but I may be wrong.

I haven't looked at the source code (if its released?) but you would want to go download and install atmel studio and create a new project and include his code. If it is like the assembler files he gave out for his other project you will most likely have to create a new project and include his files in such a way to make it compile.


micro

I'll give you some hints. But you're doing this on your own risk. I can't be held responsible if you fry your N64 Stick Converter PCB or your programmer! ;)

Modifying the code:


Get the source files for the N64 Stick Converter PCB at: http://nfggames.com/forum2/index.php?topic=5023.0 (first post, bottom)

You also need Atmel's AVR Studio 5 (AVR Studio 6 might work, too). The program is free and you get it at www.atmel.com
It might be necccessary to register an account. You can also find the direct download links at: http://www.mikrocontroller.net/articles/Atmel_Studio

After installing AVR Studio 5, unzip my source files and open "N64 Stick Converter PCB v2.1.avrsln" with a double click. After loading the project file you have to open "N64 Stick Converter PCB v2.1.c" in the solution explorer:


Now you can start to modify the code. For example you can change the min and max range (MIN_RANGE and MAX_RANGE).
When you're ready, click on "Build":


All the interesting files will be in the "Debug" folder then:



Flashing the microcontroller:

There are two common pinouts for the AVR microcontroller programming interface. A 6-pin and a 10-pin pinout. As you already said, there are 6 important wires: VCC, GND, MISO, MOSI, SCK and RESET. On this pic you can see the differences:


On my N64 Stick Converter PCB I've used the 6-pin ISP pinpout. The square pad marks pad no. 1:


I've used a small adapter with pogo pins to program the microcontroller:


If you don't have such an adapter you might need to solder the wires directly to the six pads on the PCB. If your programmer outputs it's own voltage (and I think USBasp does!), then make sure you've unplugged the N64 Stick Converter PCB from the controller!

It seems AVRdude is the way to go if you got an USBasp programmer. To be honest I've got absolutely no experience with AVRdude. But check out this fine tutorial: http://www.ladyada.net/learn/avr/avrdude.html

So to program your microcontroller, copy "N64 Stick Converter PCB v2.1.hex" and "N64 Stick Converter PCB v2.1.eep" from the "Debug" folder into C:\ as the tutorial suggests.
The command lines you need should be:

avrdude -c usbasp -P usb -p t24 -U flash:w:"N64 Stick Converter PCB v2.1.hex"
avrdude -c usbasp -P usb -p t24 -U eeprom:w:"N64 Stick Converter PCB v2.1.eep"


You don't need to set the fuse bytes because I've already set them. :) But if you want to you can set them again:
avrdude -c usbasp -P usb -p t24 -U lfuse:w:<0x42>
avrdude -c usbasp -P usb -p t24 -U hfuse:w:<0xDF>


As I don't own an USBasp programmer I can't guarantee it will work... Please report back if you have succeeded! :D

Nina

Didnt work...  :-\ i did exactly what you say micro but the avrdude give me always an error message when i try to flash the code :-\

this tuto give me some tips but... no successful answer...
http://www.ladyada.net/learn/avr/avrdude.html

i tried also with arduino program, but nop...

im a little afraid to brick my PCB(and i just have one) so i will just keep it like that...  :)

but thank you very much for the help micro!



ulao

Lots of problems with them cheepo's you really need the AVRISP mkII to be sure. Also using avr studio and setting up pins on the board like Mirco showed you is worry free. Trust me, I would have fried a chip by now at the rate I play with things. I can walk you true avr studio but you need the right stuff to do it. AVRISP mkII really is a must, the knock offs are shotty at best. I have installed the avr studio over 100 times and can help you there also.  There is nothing to be scarred of here, low voltage burners can't hurt the board, the high voltage burners can. Even if you miss wire the IPS the AVRISP mkII will indicate a short or over voltage.