• Witaj na Forum Arduino Polska! Zapraszamy do rejestracji!
  • Znajdziesz tutaj wiele informacji na temat hardware / software.
Witaj! Logowanie Rejestracja


Ocena wątku:
  • 0 głosów - średnia: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Programowanie Atmegi 328P
#1
Jestem w posiadaniu UNO3 z wyjmowaną kością Atmegi. Nabyłem kilka sztuk Atmegi i zauważyłem coś ciekawego. Kości z oznaczeniami 328P-PU działają jak oryginał ( takie ma oznaczenie oryginał) ale kości z oznaczeniami 328P-U z nimi jest problem z wygrywaniem przez USB, w menadżerze w kompie widzi Arduino, ale nic nie można wgrać, przesyłka przez ISP wchodzi. Po wypaleniu botladera i wgraniu szkicu przez ISP wszystko działa i na płytce Arduino i na mojej zrobionej " na wariata" do testów W "datasitach" nic nie znalazłem, czym różnią się te kości? Te 328P-U są nieco tańsze od tych PU ,przy zakupie nie zwróciłem uwagi na to.

Wysłane z mojego Redmi Note 4 przy użyciu Tapatalka
 
Odpowiedź
#2
Włącz pełne komunikaty podczas kompilacji i wgrywania w opcjach Arduino. Wklej co wypluwa gdy nie wgrywa szkicu przez USB.
Jak już wgrasz bootloader to nie ma różnicy, to ten program potem gada z programatorem i przedstawia się jako UNO, NANO, PRO. Możesz tak sobie wgrać bootloader UNO do NANO (w UNO jest lepszy) i używać NANO jako UNO podczas pisania programu i wgrywania.
Procek mógł mieć inną sygnaturę i programator odmówił wgrania bootloadera, ale jakbyś to wgranie wymusił to działałby tak samo. Jest też czasem problem ze sterownikami USB/ASP. Poszukaj tu na forum, były o tym wątki.
Miło być decenianym https://buycoffee.to/kaczakat
 
Odpowiedź
#3
Może to tak jak z Atmega644 i 644P, niby te same a różnią się różnią się rejestrami i bitami. Na pewno nota katalogowa podpowie.
Pozdrawiam
 
Odpowiedź
#4
"C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977\sketch\Blink.ino.cpp" -o "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977\preproc\ctags_target_for_gcc_minus_e.cpp"
Kompilowanie szkicu...
"C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10805 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino" "-IC:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\variants\standard" "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977\sketch\Blink.ino.cpp" -o "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977\sketch\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/Blink.ino.elf" "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977\sketch\Blink.ino.cpp.o" "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/..\arduino_cache_113432\core\core_arduino_avr_uno_bf922930b918e751f9009e10739e64c2.a" "-LC:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977" -lm
"C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/Blink.ino.elf" "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/Blink.ino.eep"
"C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.4-arduino2/bin/avr-objcopy" -O ihex -R .eeprom "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/Blink.ino.elf" "C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/Blink.ino.hex"
Szkic używa 928 bajtów (2%) pamięci programu. Maksimum to 32256 bajtów.
Zmienne globalne używają 9 bajtów (0%) pamięci dynamicznej, pozostawiając 2039 bajtów dla zmiennych lokalnych. Maksimum to 2048 bajtów.
C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/bin/avrdude -CC:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:C:\Users\Zbyszko\AppData\Local\Temp\arduino_build_294977/Blink.ino.hex:i

avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
Copyright © 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright © 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Users\Zbyszko\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

Using Port : COM3
Using Programmer : arduino
Overriding Baud Rate : 115200
 
Odpowiedź
#5
jaką masz wersję arduino IDE ? ja używam 1.6.0 na wyższych miałem problemy z płytką.
pozdrawiam
 
Odpowiedź
#6
Nie wiem co masz za wersję, przykładowo u mnie po kompilacji wypluwa tak:
Kod:
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2014 Joerg Wunsch

        System wide configuration file is "C:\Users\X\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

        Using Port                    : COM30
        Using Programmer              : arduino
        Overriding Baud Rate          : 115200
        AVR Part                      : ATmega168
        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    20     4    0 no        512    4      0  3600  3600 0xff 0xff
          flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

        Programmer Type : Arduino
        Description     : Arduino
        Hardware Version: 3
        Firmware Version: 5.0
        Vtarget         : 0.3 V
        Varef           : 0.3 V
        Oscillator      : 28.800 kHz
        SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9406 (probably m168)
avrdude: reading input file "C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex"
avrdude: writing flash (2856 bytes):

Writing | ################################################## | 100% 0.45s

avrdude: 2856 bytes of flash written
avrdude: verifying flash memory against C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex:
avrdude: load data flash data from input file C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex:
avrdude: input file C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex contains 2856 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.35s

avrdude: verifying ...
avrdude: 2856 bytes of flash verified

avrdude done.  Thank you.
A tak dla UNO z chipem SMD:
Kod:
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2014 Joerg Wunsch

        System wide configuration file is "C:\Users\X\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

        Using Port                    : COM25
        Using Programmer              : arduino
        Overriding Baud Rate          : 115200
        AVR Part                      : ATmega168
        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    20     4    0 no        512    4      0  3600  3600 0xff 0xff
          flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

        Programmer Type : Arduino
        Description     : Arduino
        Hardware Version: 3
        Firmware Version: 5.0
An error occurred while uploading the sketch
        Vtarget         : 0.3 V
        Varef           : 0.3 V
        Oscillator      : 28.800 kHz
        SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATmega168 is 1E 94 06
        Double check chip, or use -F to override this check.

avrdude done.  Thank you.
Nie wgrało, bo nie było kompilowane dla UNO
Po zmianie procka w ustawieniach Arduino:
Kod:
avrdude: Version 6.3, compiled on Jan 17 2017 at 12:00:53
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2014 Joerg Wunsch

        System wide configuration file is "C:\Users\X\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino9/etc/avrdude.conf"

        Using Port                    : COM25
        Using Programmer              : arduino
        Overriding Baud Rate          : 115200
        AVR Part                      : ATmega328P
        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    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
          flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
          lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
          calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
          signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

        Programmer Type : Arduino
        Description     : Arduino
        Hardware Version: 3
        Firmware Version: 5.0
        Vtarget         : 0.3 V
        Varef           : 0.3 V
        Oscillator      : 28.800 kHz
        SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex"
avrdude: writing flash (2856 bytes):

Writing | ################################################## | 100% 0.45s

avrdude: 2856 bytes of flash written
avrdude: verifying flash memory against C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex:
avrdude: load data flash data from input file C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex:
avrdude: input file C:\Users\X\AppData\Local\Temp\arduino_build_720692/SleepArduinoWDT_ExtInt.ino.hex contains 2856 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.35s

avrdude: verifying ...
avrdude: 2856 bytes of flash verified

avrdude done.  Thank you.
Sprawdź czy nie masz problemu jak tu:
https://forum.arduinopolska.pl/watek-unu...ootloadera
lub https://forum.arduinopolska.pl/watek-b%C...ca-dioda-l
Miło być decenianym https://buycoffee.to/kaczakat
 
Odpowiedź
#7
IDE wersja 1,85 jak w UNO siedzi 328P-PU jest ok, ale jak włożę 328P-U przez USB wywala taki komunikat i nie idzie nic wgrać. Przez ISP śmiga.
 
Odpowiedź
#8
Ale komunikat zamieszczony przez Ciebie nic nie mówi o błędzie przy wgrywaniu. Przeczytaj wskazane wątki, znajdź AVRLAB++ i zobacz co ten program powie. Najprawdopodobniej nie wgrałeś bootloadera, miałem taką sytuację z prockiem Atmega88 , wgrałem bootloader metodą "naokoło" i teraz wykrywa go jako inny procek przez USB/UART/BOOTLOADER (tak jak się przedstawia bootloader), a inaczej przez USBASP - zgodnie z sygnaturą zaszytą w chipie. Jest to opisane w pierwszym linku.
Lub zajrzyj tu, wątek sprzed 6 lat dla Twojego procka, (ja zrobiłem podobnie dla Atmegi88, nie musiałem grzebać w konfigu AVRDUDE): http://forum.arduino.cc/index.php?topic=108697.0 user kf2qd.
Miło być decenianym https://buycoffee.to/kaczakat
 
Odpowiedź
  


Skocz do:


Przeglądający: 1 gości