私は、arduino uno R3をISPプログラマとして使用して、ATMELのATMEGA32A-PUマイクロコントローラをプログラミングしようとしています。ここにあるチュートリアルに従っていた:http://hackaday.com/2010/10/23/avr-programming-introduction/Arduino R3を使用してATMEGA32A-PUをプログラミングする
このチュートリアルでは、ATMEGA168チップのプログラミングについて説明します。私はATMEGA32のデータシートを調べ、配線を調整しました。私は正しく信じています。そして、チップをプログラムするためにavrdudeを使用しています。
私はWindows 10 x64を使用しています。 WinAVR-20100110をダウンロードしました。
hackadayの指示から私はarduino IDEのFILE-> examplesのArduinoISPスケッチを使ってarduinoをロードしました。私は変更を加えなかった。 10アルドゥイーノする(RST)13
9アルドゥイーノする12
8(SCK)をArduinoのために11
7(MISO)をアルドゥイーノする
6(MOSI):
atmega32チップ上のピンがこのように接続されています。
10(VCC)GND
に
31(GND)を5VにGND
30(AVCC)に
11(GND)を5VにIは、電力およびgrouを供給するためのArduinoの5VおよびGNDピンを使用していAVRに連絡してください。 CMDプロンプトから私が実行しています:avrdude -v -P COM3 -b 19200 -c avrisp -p atmega32 -U flash:w:main.hex
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : COM3
Using Programmer : avrisp
Overriding Baud Rate : 19200
AVR Part : ATMEGA32
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
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 4 10 64 0 no 1024 4 0 9000 9000 0xff 0xff
flash 33 6 64 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
lock 0 0 0 0 no 1 0 0 2000 2000 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
calibration 0 0 0 0 no 4 0 0 0 0 0x00 0x00
Programmer Type : STK500
Description : Atmel AVR ISP
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.06s
avrdude: Device signature = 0x1e9502
avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 99
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (144 bytes):
Writing | ################################################## | 100% 0.22s
avrdude: 144 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 144 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 0.12s
avrdude: verifying ...
avrdude: 144 bytes of flash verified
avrdude: safemode: lfuse reads as E1
avrdude: safemode: hfuse reads as 99
avrdude: safemode: Fuses OK
avrdude done. Thank you.
それはプログラミングを通過し、それが正常に144のバイトを書いたと言います。私はstk500を使ってみましたが、上記のコマンドの出力には言及していますが、私はそれを行うとタイムアウトエラーが発生します。私がしようとしているのはテスト目的のために、PORTDから8個のLEDを点灯させることです。私はavr/io.hと
を含んでいますint main(void)
{
DDRD |= 0xff; //Set PortD Pins as an output
PORTD |= 0xff; //Set PortD Pins high to turn on LEDs
while(1) { } //Loop forever
}
残念ながら、PD1は唯一のライトアップにつながっています。残りの人は何もしません。
ブレッドボードに接続されたマイクロコントローラは、ピン4-21がそれぞれ470Ωの抵抗に接続されています。抵抗は、それぞれ独自のLEDに接続し、LEDはグランドに接続します。
正しくプログラミングしているようです。 Avrdudeは正しく応答しており、atmega32から何らかの動作が得られています。しかし、LEDがAtmega32にどのように接続されているかは教えてください。それはいくつかの標準的なdevのボードですか? – UncleO
何らかの配線問題があるかもしれません。 1つの可能性は、ポートを流れる電流が非常に制限されていることです。抵抗には適切な値が設定されていない可能性があります。 PD1 LEDはどれくらい明るいですか?それを取り外すと、別のLEDが点灯しますか? – UncleO
それで、文字通りちょっとした変更を加えました。私は問題を解決しました。それは私が従っていた指示書から提供されたmakefileにありました。私はmakefileにAVRを指定したことを認識しませんでした。私は、COM3上でATMEGA32をプログラミングしていて、プログラムをリロードして今すぐ動作すると言い換えました。 – jwaldorf2