Show Posts
Pages: 1 [2] 3 4 ... 7
16  Using Arduino / Microcontrollers / ATMEGA32U4 Breakout Board Issue - Analog Pins as Digital on: December 13, 2011, 10:21:59 am
Hey all

i have an interesting issue i can't seem to figure out.
i have an ATMEGA32U4 Breakout Board running the Leonardo bootloader.

When i do:
pinMode([0-17], OUTPUT);
digitalWrite([0-17],[HIGH|LOW]);
everything works as intended.

When i try to address the Analog Pins (A0-A5) on Port F(PF0-PF7) as Digital pins
pinMode([18-23], OUTPUT);
digitalWrite([18-23], [HIGH|LOW]);
no dice

my question is, on the ATMEGA32U4, can the Analog Pins not be used as Digital Pins as they where on the ATMEGA328?
17  Development / Other Hardware Development / Re: Single-sided Arduino-Leonardo board on: November 30, 2011, 04:37:16 pm
Almost done, used 16 jumper wires:

ISP header for bootloader?
18  Using Arduino / Microcontrollers / Re: Leonardo Clone out already! on: November 14, 2011, 12:05:59 pm
Nice design!!!
I have been using the ATMEGA32U4 from Adafruit with Arduino 1.0 Bootloader with great success.

And the below seems to be the correct pin mapping from hardware/arduino/variants/leonardo/pins_arduino.h

Code:
// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
//
// D0 PD2 RXD1/INT2
// D1 PD3 TXD1/INT3
// D2 PD1 SDA SDA/INT1
// D3# PD0 PWM8/SCL OC0B/SCL/INT0
// D4 A6 PD4 ADC8
// D5# PC6 ??? OC3A/#OC4A
// D6# A7 PD7 FastPWM #OC4D/ADC10
// D7 PE6 INT6/AIN0
//
// D8 PB4 ADC11/PCINT4
// D9# A8 PB5 PWM16 OC1A/#OC4B/ADC13/PCINT5
// D10# A9 PB6 PWM16 OC1B/0c4B/ADC12/PCINT6
// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
// D12 A10 PD6 T1/#OC4D/ADC9
// D13# PC7 PWM10 CLK0/OC4A
//
// A0 PF7 ADC7
// A1 PF6 ADC6
// A2 PF5 ADC5
// A3 PF4 ADC4
// A4 PF1 ADC1
// A5 PF0 ADC0
//
// New pins D14..D17 to map SPI port to digitial pins
//
// D14 PB0 RXLED,SS/PCINT0
// D15 PB1 SCK,PCINT1
// D16 PB2 MOSI,PCINT2
// D17 PB3 MISO,PCINT3
//
// TXLED PD5
// RXLED     PB0
// HWB PE2 HWB
19  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 16, 2011, 09:51:51 am
Therefore the IDE must be told to use a Uno board, not the board you added stating it's a 328 chip, that was required just to allow the burn bootloader step, where the signature is being read directly from the chip.

this is the most accurate and clear explanation i have heard. never thought about it as being a false positive!
20  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 16, 2011, 08:50:17 am
@h4t

yes, i was able to use the Arduino itself as an ISP.

here is the complete entry in my boards file

Code:
sparky.name=Sparky
sparky.upload.protocol=stk500
sparky.upload.maximum_size=32256
sparky.upload.speed=115200
sparky.bootloader.low_fuses=0xff
sparky.bootloader.high_fuses=0xde
sparky.bootloader.extended_fuses=0x05
sparky.bootloader.path=optiboot
sparky.bootloader.file=optiboot_atmega328.hex
sparky.bootloader.unlock_bits=0x3F
sparky.bootloader.lock_bits=0x0F
sparky.build.mcu=m328au
sparky.build.f_cpu=16000000L
sparky.build.core=arduino

notes
1. using an Arduino Uno with the Opti Boot bootloader.
2. successfully able to bootload the ATMEGA328-AU selecting the board above from the boards list
3. after the success of the bootloader, when i attempt to upload a sketch i get 'm328au' is not a recognized device
4. knowing the bootloader was successful but upload sketch failed i was able to upload a sketch by changing the board to simply Arduino UNO (go figure)
5. this was the same on OSX Lion, Windows 7, Vista 64

hope that helps
21  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 15, 2011, 05:21:54 am
hmm,
haven't tried via the arduino itself as an isp for this edit.
only AVR ISP mkII and the Pocket Programmer from Spark Fun

i will try when i get home this evening
22  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 14, 2011, 07:41:35 am
That error looks very odd as if you are missing a part of the .conf file.
Did you add an entire duplicate entry or only the portion i posted?
23  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 10, 2011, 04:54:45 am
Creating a new entry worked beautifully

Code:
#------------------------------------------------------------
# ATmega328-AU-ND
#------------------------------------------------------------

part
    id              = "m328au";
    desc            = "ATMEGA328-AU-ND";
     has_debugwire = yes;
     flash_instr   = 0xB6, 0x01, 0x11;
     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
             0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode  = 0x86;
    # avr910_devcode = 0x;
    signature       = 0x1e 0x95 0x14;


and then in boards.txt

Code:
.build.mcu=m328au

thanks again for all your helps
24  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 09, 2011, 03:18:56 pm
silly question but where do i find the avrdude.conf on PC
25  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 09, 2011, 11:13:29 am
Okay, so turns out i actually have an ATMEGA328-AU-ND not an ATMEGA328P-AU-ND   

any suggestions?
26  Using Arduino / Microcontrollers / Re: Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 09, 2011, 10:27:54 am
i take it i can add a new board to the boards.txt file.
like so

Code:
[new board name].build.mcu=atmega328p

where can i change the mcu listing type. i can't find how to add the AU
27  Using Arduino / Microcontrollers / Burining Bootloader via AVRISP-MKII onto ATMEGA328-AU on: August 09, 2011, 05:49:42 am
having issues with using an AVRISP-MKII to burn a bootloader for an ATMEGA328-AU (the same as on the Pro and Pro Mini)

Error:
Code:
avrdude: Expected signature for ATMEGA328P is 1E 95 0F


I have a schema here



any thoughts?
28  Using Arduino / Microcontrollers / Re: ISP Bootloader onto ATMEGA328-AU + AVR Pocket Programmer on: July 15, 2011, 07:26:59 am
bah.

this is what verbose gives me

Code:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cusbtiny -F -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/eugene/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : unknown
         Using Programmer      : usbtiny
         AVR Part              : ATMEGA328P
avrdude: Using SCK period of 10 usec
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         RESET disposition     : dedicated
         RETRY pulse           : SCK
         serial program mode   : yes
         parallel program mode : yes
         Timeout               : 200
         StabDelay             : 100
         CmdexeDelay           : 25
         SyncLoops             : 32
         ByteDelay             : 0
         PollIndex             : 3
         PollValue             : 0x53
         Memory Detail         :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : USBTINY
         Description     : USBtiny simple USB programmer

CMD: [ac 53 00 00] [ae 53 00 00]
CMD: [ac 53 00 00] [ac 53 80 00]
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions

CMD: [30 00 00 00] [30 00 00 00]
CMD: [30 00 01 00] [30 00 01 00]
CMD: [30 00 02 00] [30 00 02 00]
Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: current erase-rewrite cycle count is 8388736 (if being tracked)
avrdude: erasing chip
CMD: [ac 80 00 00] [be 80 00 00]
avrdude: Using SCK period of 10 usec
CMD: [ac 53 00 00] [ac 53 80 00]
CMD: [ac 53 00 00] [ae 53 80 00]
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

CMD: [58 00 00 00] [1c 00 00 00]
CMD: [ac e0 00 ff] [ac 70 00 ff]
CMD: [58 00 00 00] [5c 00 00 00]
CMD: [58 00 00 00] [5c 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [5c 00 00 00]
CMD: [58 00 00 00] [5c 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [5c 00 00 00]
CMD: [58 00 00 00] [5c 00 00 00]
CMD: [58 00 00 00] [08 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [58 00 00 00]
CMD: [58 00 00 00] [48 00 00 00]
Writing |  ***failed; 
################################################## | 100% 0.04s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

CMD: [58 00 00 00] [58 00 00 00]
Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0x3f != 0x00
avrdude: verification error; content mismatch

avrdude done.  Thank you.

29  Using Arduino / Microcontrollers / Re: ISP Bootloader onto ATMEGA328-AU + AVR Pocket Programmer on: July 14, 2011, 11:35:49 am
hmm, interesting, i am making some progress but now getting a whole new error

Arduino IDE
Code:
avrdude: initialization failed, rc=-1
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328 is 1E 95 14
 ***failed; 
avrdude: verification error, first mismatch at byte 0x0000
         0x3f != 0x00
avrdude: verification error; content mismatch

in the avrdude.conf file i added a new board (copied the m328p one)
Code:
    id              = "m328";
    desc            = "ATMEGA328";
     has_debugwire = yes;
     flash_instr   = 0xB6, 0x01, 0x11;
     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
             0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode  = 0x86;
    # avr910_devcode = 0x;
    signature       = 0x1e 0x95 0x14;
...

in boards.txt i created a new board copied from 'pro5v328'
Code:
##############################################################

sparky.name=Sparky Jr + SparkyISP

sparky.upload.protocol=stk500
sparky.upload.maximum_size=30720
sparky.upload.speed=57600

sparky.bootloader.low_fuses=0xFF
sparky.bootloader.high_fuses=0xDA
sparky.bootloader.extended_fuses=0x05
sparky.bootloader.path=atmega
sparky.bootloader.file=ATmegaBOOT_168_atmega328.hex
sparky.bootloader.unlock_bits=0x3F
sparky.bootloader.lock_bits=0x0F

sparky.build.mcu=atmega328
sparky.build.f_cpu=16000000L
sparky.build.core=arduino

and in programmers.txt i added a new copy of USBtinyISP
note that i am forcing -F
Code:
sparkyisp.name=SparkyISP
sparkyisp.protocol=usbtiny
sparkyisp.force=true

now i am at a loss.
30  Using Arduino / Microcontrollers / Re: ISP Bootloader onto ATMEGA328-AU + AVR Pocket Programmer on: July 14, 2011, 05:26:47 am
thanks, will try.
now to confirm, the order you have there is low, high, extended?
Pages: 1 [2] 3 4 ... 7