Show Posts
Pages: 1 2 [3] 4 5 ... 516
31  Using Arduino / Microcontrollers / [SOLVED] Building ATMEGA32U4 bootloader and pin 13 behavior on: September 16, 2014, 01:10:56 am
[UPDATE]
In this thread, I was asking questions about how to build an ATMEGA32U4 bootloader in order to regain control of the TXLED, RXLED, and L_LED (pin 13) pins for my project. I succeeded with the help of hiduino and some online information. I started at a question on L_LED.

[ORIGINAL]
So with my barebone ATMEGA32U4/Arduino micro setup, whenever I upload code, pin 13's LED flickers. I don't know why it would do that. Any hint? Is it used as an output pin during program upload?

I was planning to use the pin to sense a rotary encoder channel. If the channel is closed then I fear the pin will get damaged during program upload if it is turned into output. Should I just add a 1K resistor from it to the encoder channel? Unfortunately I'll have use use all the chip's pins for my project so I'm not letting pin 13 just sit idling. 4 pins for sd card, 6 pins for lcd, 3 for encoder with button, 2 for I2C sensors and internal RTC, 6 in groups of 2 for 3 "input channels", then 2 pin serial for xbee, 1 battery sense and 1 buzzer.

Any comment is appreciated!
32  Using Arduino / Microcontrollers / Re: Help me with ATMEGA32U4: Can't program with Arduino IDE on: September 16, 2014, 12:10:13 am
Damn! I shouldn't have used Nick's code! I followed this tutorial and used UNO to bootload the ATMEGA32U4. It worked!

http://murchlabs.com/monday-experiment-bootloading-an-atmega32u4-with-arduino/

I don't know why the cap between host Arduino RESET and GND is needed but as long as it works. I don't complain. I still think that somehow if I can make Nick's fuse setting more flexible then I can get it to work too.

I wonder which bootloader is used.

I also wonder what fuses the arduinoisp set my chip to. Too lazy to rewire it to run Nick's code. smiley-sad

In the future I need to recompile the bootloader to use my own VID (if I can afford) so I'll have to find the right code soon. Any hint?
33  Using Arduino / Microcontrollers / Re: Help me with ATMEGA32U4: Can't program with Arduino IDE on: September 15, 2014, 11:43:04 pm
Also I had to change LFuse from 0x5E to 0xDE so that the freq/8 option is turned off. I just can't do the HFuse with Nick's code.

And, something seems wrong: Caterina-Micro.hex is 76KB. That is like 16KB of code. That is a real program!!! There is something wrong with the size. The Caterina lilypad USB is only 4KB with 12KB HEX. This is what I expected:

http://arduino.cc/en/Main/ArduinoBoardMicro

It says 4K is used by bootloader.

OK, I took another look at the Caterina-Micro.hex. It does have 4KB in the end, 4,832 bytes in the beginning and just empty space in between, making up not 16KB, but 32KB of program space. So what is the purpose of the first 4,832 bytes? Is the bootloader area not large enough so it spills over to this memory location? I read the relevant info from boards.txt

Nick's program has the following:

Code:
 // Atmega32U4 family
  { { 0x1E, 0x94, 0x88 }, "ATmega16U4",  16 * kb,       512,   128,  highFuse },
  { { 0x1E, 0x95, 0x87 }, "ATmega32U4",  32 * kb,       512,   128,  highFuse },

I don't understand why the ATMEGA32U4 has only 512 bytes of bootloader size. Is this a mistake?

How do you flash bootloader on your ATMEGA32U4? I'm frustrated.
34  Using Arduino / Microcontrollers / Help me with ATMEGA32U4: Can't program with Arduino IDE on: September 15, 2014, 11:27:57 pm
My bare-bone ATMEGA32U4 system is having a hard time getting programmed by Arduino IDE.

Here is what I have:

1 ATMEGA32U4 on a TQFP-44 adapter board from adafruit, on a breadboard
16MHz crystal with 22pF caps
HWB_bar pin is grounded
Arduino pin 13 has LED + resistor to GND
D+, D-, UGND, VUSB connected to a USB cable I found from spare part
I have a 0.1uF cap on the UCAP instead of 1uF the Micro has.

Programmer wise I have an arduino UNO with Nick Gammon's Hex loader:

http://www.gammon.com.au/forum/?id=11638

Successes:
1. I loaded caterina Micro bootloader with Nick's hex loader. The LED on pin 13 blinks after this. It also enumerated a serial port saying "Arduino Micro" on my device manager.
2. I loaded a blink sketch that I compiled for arduino micro with Nick's hex loader. I set the pin 13 led to blink quickly. It worked. It also enumerated a serial port saying "Arduino Micro" on my device manager.

Failure:
1. Although I loaded the bootloader, I can't program it using Arduino IDE. The serial port disappears during programming but the IDE reports it can't find a Leonardo.

Can someone help? Thanks.

Also here is the fuse settings with bootloader loaded:
LFuse = 0x5E (bit 7: divide clock by 8 is zero, or programmed. Change to 0xDE)
HFuse = 0x99
EFuse = 0xF3
Lock byte = 0xFF
Clock calibration = 0x5D

I read about the HFuse. I think it should be 0x98 to make the bootloader run but Nick's program won't let me change it. It was 98 when I first loaded a bootloader but changed to 0x99 after I loaded blink.
35  Using Arduino / Project Guidance / Re: relay module control via software on: September 13, 2014, 11:51:11 pm
Use Processing Firmata sample code on PC and and Arduino Firmata code on Arduino. This gives direct control of Arduino I/O. No need to reinvent the wheel.
36  Using Arduino / Project Guidance / Re: Help with Sensor selection on: September 11, 2014, 09:10:41 pm
Ask this company about their demonstration of an LED candle with temperature sensor on a muffin at 2011 AAPT summer meeting:

http://www.vernier.com/

I can't find where they host that content.
37  Using Arduino / Project Guidance / Re: Pi communication on: September 11, 2014, 04:13:42 pm
In case of USB port, get a cheap USB TTL adapter for a few USD. The hard part if you use C/C++ on PI is to disable all the crappy terminal features of a serial port. If you use python, there seems to be an easy way to do it. What does the book author say (GM)?
38  Using Arduino / Project Guidance / Re: Wireless network without coordinator on: September 11, 2014, 04:10:58 pm
Digi-mesh firmware is really neat. They also have new radios the 900 MHz pro HP (high power) so don't buy series 2 modules from other places, which are phased out (you can still load earlier digi-mesh firmware to them). If you want to explore the modules, such as checking them out or manually doing some tests or firmware upload, a sparkfun xbee explorer is a must have. The arduino official wireless shield can't properly reset xbees for firmware upload. You will brick them and have to call digi for some help.
39  Using Arduino / Project Guidance / Re: Pi communication on: September 11, 2014, 04:05:35 pm
OP is using 3.3V version arduino pro so a direction connection as OP described should be sufficient.
40  Using Arduino / Project Guidance / Re: Help with Sensor selection on: September 10, 2014, 11:19:17 pm
Using a thermistor will detect wind blown when temperature changes. Someone made an electronic candle with this method. No problem with noise.
41  Using Arduino / Project Guidance / Re: issue with ethernet sheild on: September 10, 2014, 11:12:18 pm
I have the same issue using dhcp and an official shield with a mac address sticker, if I use a random mac address. Don't know why. I had to use the sticker address or else maybe static ip. For your server project, why not using a static address? Easier to remember.
42  Using Arduino / Project Guidance / Re: Pi communication on: September 10, 2014, 11:06:25 pm
Use pi serial port.
43  Using Arduino / Project Guidance / Re: Wireless network without coordinator on: September 10, 2014, 11:04:22 pm
HAVE YOU HEARD OF DIGIMESH oops, shift key stuck. Get 900MHz pro modules with digimesh firmware from digi directly. Any module acts as a router. Don't try to get their routing gateway. Built to order, lead time 3 to 6 months. Crap!
44  Using Arduino / Project Guidance / Re: Which arduino for my project with 100's of led's and sound? on: September 10, 2014, 10:55:31 pm
It takes no longer to propagate from one cell to the next as to propergate to 1000 cells. If you think about it just before the last shift clock pulse all the bits are only one cell away from where they should be.

I thought there is a short delay between first bit shifted in and last bit shifted out, which drives the next shift register. I will find some reference on 74HC595.
45  Using Arduino / Project Guidance / Re: Which arduino for my project with 100's of led's and sound? on: September 10, 2014, 03:55:48 pm
CR,

For that many shift registers, do you need to wait long enough for the signals to propagate to the last register before toggling the enable or storage pin? Also, if OP needs 100-200, will 25 shift registers be able to work in series? I only used a couple of them in series.
Pages: 1 2 [3] 4 5 ... 516