匿名
尚未登入
登入
flip the world
搜尋
檢視Arduino Pro Mini, ATMega328P的原始碼
出自flip the world
命名空間
頁面
討論
更多
更多
頁面操作
閱讀
檢視原始碼
歷史
←
Arduino Pro Mini, ATMega328P
您沒有權限執行編輯此頁面,由於以下原因:
您請求的操作只有這個群組的使用者能使用:
使用者
您可以檢視並複製此頁面的原始碼。
== Toolchain == * sudo apt-get install gcc-avr # A port of GCC to AVR target processor * sudo apt-get install gdb-avr # AVR GNU debugger * sudo apt-get install binutils-avr #low-level utilities for building & manipulating object files * sudo apt-get install avr-libc # AVR Library files * sudo apt-get install avrdude # command-line program for programming AVR chips. == Pin definition == [[File:ProMiniPinout.png|ProMiniPinout]] == PORT mapping == * PORTD maps to Arduino digital pins 0 to 7 ** DDRD - The Port D Data Direction Register - read/write ** PORTD - The Port D Data Register - read/write ** PIND - The Port D Input Pins Register - read only * PORTB maps to Arduino digital pins 8 to 13 The two high bits (6 & 7) map to the crystal pins and are not usable ** DDRB - The Port B Data Direction Register - read/write ** PORTB - The Port B Data Register - read/write ** PINB - The Port B Input Pins Register - read only * PORTC maps to Arduino analog pins 0 to 5. Pins 6 & 7 are only accessible on the Arduino Mini ** DDRC - The Port C Data Direction Register - read/write ** PORTC - The Port C Data Register - read/write ** PINC - The Port C Input Pins Register - read only == LED blinking example == * Make sure your makefile have defined F_CPU for clock <pre> #ifndef F_CPU #define F_CPU 16000000UL // 16 MHz clock speed #endif #include <avr/io.h> #include <util/delay.h> int main(void) { DDRC = 0xFF; //Nakes PORTC as Output while(1) //infinite loop { PORTC = 0xFF; //Turns ON All LEDs _delay_ms(1000); //1 second delay PORTC= 0x00; //Turns OFF All LEDs _delay_ms(1000); //1 second delay } } </pre> == Program == [[File:IMAG0194.jpg|250px|Arduino_FTDI connectivity]] * The connections to make from the FTDI FT232RL and the Pro Mini are: <pre> FTDI232 Arduino_mini GND --> GND CTS --> GND VCC --> VCC (5V for Ardunio Pro Mini 328 - DEV-1113) TXD --> RXD RXD --> TXD DTR --> DTR </pre> * Program command ** make program ...or ** sudo avrdude -q -c arduino -P /dev/ttyUSB2 -b 57600 -p atmega328p -U flash:w:led.hex <pre> avrdude: AVR device initialized and ready to accept instructions avrdude: Device signature = 0x1e950f 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 "led.hex" avrdude: input file led.hex auto detected as Intel Hex avrdude: writing flash (146 bytes): avrdude: 146 bytes of flash written avrdude: verifying flash memory against led.hex: avrdude: load data flash data from input file led.hex: avrdude: input file led.hex auto detected as Intel Hex avrdude: input file led.hex contains 146 bytes avrdude: reading on-chip flash data: avrdude: verifying ... avrdude: 146 bytes of flash verified avrdude: safemode: Fuses OK avrdude done. Thank you. </pre> == [[application - BMA250, triaxial acceleration sensor ]] == == Reference == * [https://electrosome.com/blinking-led-atmega32-avr-microcontroller/, Blinking LED using Atmega32 Microcontroller and Atmel Studio] * [https://www.arduino.cc/en/Reference/PortManipulation, Port Registers]
返回到「
Arduino Pro Mini, ATMega328P
」。
導覽
導覽
首頁
近期變更
隨機頁面
MediaWiki說明
wiki工具
wiki工具
特殊頁面
頁面工具
頁面工具
使用者頁面工具
更多
連結至此的頁面
相關變更
頁面資訊
頁面日誌