User Tools

Site Tools


dig:uc2
no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Next revision
dig:uc2 [2016/02/28 15:13] – [Tool installation] tobi
Line 1: Line 1:
 +====== Microcontroller resources ======
  
 +The class uses an [[http://en.wikipedia.org/wiki/Atmel_AVR|Atmel AVR]] microcontroller from [[http://www.atmel.com|Atmel]], specifically, the ATmega type controller [[http://www.atmel.com/devices/ATMEGA328P.aspx|ATmega328P]], mounted on a small open-source development board called [[http://arduino.cc/en/Main/ArduinoBoardNano|Arduino Nano]] board developed by [[http://gravitech.us|Gravitech]] and supported by [[http://arduino.cc/|Arduino]]. It can be bougth in [[http://www.amazon.de/s/ref=nb_sb_noss_1?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&url=search-alias%3Daps&field-keywords=Arduino%20nano|Amazon]] at really good prices.
 +
 +{{:dig:arduinonano.jpg?200|The Arduino Nano board}}
 +
 +The Atmel mega chips are 8-bit RISC procesor optimized for small code size that allow up 2KB bootloader to avoid the use of specific programmers. The ATmega328 has 32KB flash, 2KB SRAM, 1KB EEPROM. It can work in a range of CPU clock frequencies, which maximum depends on the power supply (4-20MHz). It has other features like GPIOs, ADC, Timers (for PWM), USART, SPI and TWI(I2C).
 +
 +It is supported by Arduino, so you can simplify your designs using C-Sketch programming style, under the Arduino software tool, that is multiplatform (developed with JAVA). By downloading to its Flash memory a specific bootloader, you can reprogram the code through its UART, that is connected to a FTDI chip to your laptop USB port.
 +
 +Programming style is completely based on available libraries that reduces development time considerably. Many examples are included in the development tool and there are plenty of available examples on internet.
 +===== Tool installation =====
 +
 +Development tool can be downloaded directly from [[http://arduino.cc/en/Main/Software#toc1|Arduino web site]]. We recommend to download and install the latest stable version (1.6.0 in 2015)
 +
 +For a proper installation and first connection, you can follow these [[http://arduino.cc/en/Guide/Windows| recommendations]]
 +
 +USB interface of Arduino Nano board uses a dedicated USB to UART chip from [[http://www.ftdichip.com/|FTDI]] or a Chinese clone CH340G, so [[http://www.ftdichip.com/Drivers/CDM/CDM%202.08.30%20WHQL%20Certified.zip|FTDI drivers]] pr [[http://www.wch.cn/download/CH341SER_EXE.html|CH340 drivers]] must be installed in those operating systems where it is not automatically recognized.
 +
 +Note that the Nano boards distributed in 2015 do NOT use an FTDI chip. Instead, the default Windows driver search should be used to find the proper driver.
 +
 +
 +===== Starting a new project =====
 +Once you open the software development tool a new project is ready or programming. Sketch programming style is based on C-language but it simplifies it to the maximum. 
 +
 +The only mandatory two functions that must have your code are:
 +* void setup(void) {} : is called once after the reset.
 +* void loop(void) {} : its content is executed iteratively until the power is switch off or a reset signal is received.
 +No headers declarations are needed. 
 +
 +You can open available examples from the File menu of the development tool. A good starting point could be Blink example of Basic category.
 +
 +{{:dig:arduinoide_blink.png?400|}}
 +
 +The button on the left verifies the source code, the next button (with an arrow pointing to right) compiles and download the code to the Arduino through the USB cable. This second button is enough for working. But before pressing that button you must select the proper serial port (check on Windows Device Manager), proper board (Arduino Nano w/ ATmega328) and programmer (AVRISP) from Tools menu. 
 +
 +The remaining three buttons allows you to create a new project, to open an existing one or to save current project.
 +
 +
 +===== Make ATmega328P board compatible with Arduino Sketches =====
 +
 +If you solder your own Arduino Nano board, you have to know that ATmega328P come with any boot loader when bought separately. Therefore, after you finish the hard work of soldering you Arduino board (specially for Array Resistors), you need to proceed to flash the boot loader.
 +
 +This boot loader flashing can be done by yourself using your commercial Arduino Nano board as an ISP programmer. [[https://docs.google.com/presentation/d/1V97HddnuJwIoUfy1asYRMTFhnoszM8Y7rIfqePcu_bM/edit?usp=sharing|In this link you can see all the steps for success.]]
 +
 +===== Documentation =====
 +
 +
 +  * {{:dig:atmega328p.pdf|ATmega328P datasheet}} - for peripherals and electrical specifications.
 +  * [[http://arduino.cc/en/Guide/ArduinoNano|Arduino Nano support]] - for starting and troubleshooting guides.
 +  * [[http://arduino.cc/en/Main/ArduinoBoardNano|Arduino Nano Hardware]] - describes the hardware in details.
 +  * [[http://arduino.cc/en/Reference/HomePage|Language Reference]] - give all details of Sketches programing resources.
 +  * [[http://arduino.cc/en/Reference/Libraries|Arduino libraries]] - for a set of available and useful libraries.
 +
 + 
 +  * {{:dig:arduinonano30schematic.pdf|Arduino Nano v3.0 Schematics}}
 +  * {{:dig:arduino_nano_top.pdf|PCB Top layer}} - Layout of the TOP layer of the PCB with comments.
 +  * {{:dig:arduino_nano_bottom.pdf|PCB Bottom layer}} - Layout of the BOTTOM layer of the PCB with comments.
 +  * {{:dig:bom_farnell.xlsx|board BOM}} - Bill Of Materials: list of components on the Arduino Nano v3.0 board.
 +
 +  * {{:dig:2-making_your_arduino_nano_compatible_with_sketches.pdf|How to flash a boot loader without a programmer.}}
 +=== For Arduino Nano with CH340 USB serial interface chip ===
 +
 +  * [[http://www.wch.cn/download/CH341SER_EXE.html|CH340ser driver for windows/linux/macos from wch.cn]]
 +  * {{:dig:ch341ser.zip|Copy of earlier Windows CH340 drivers zip file for Chinese serial USB chip}}
 +
 +===Windows===
 +
 +  * {{:dig:arduino-1.0.5-windows.exe|Arduino-Studio IDE Installer}} - this is the main IDE for code development
 +  * {{:dig:cdm_2.08.30_whql_certified_x32.zip|FTDI x86 drivers}} or {{:dig:cdm_2.08.30_whql_certified_x64.zip|x64}} - needed to properly program the board through FTDI USb to UART converter. .
 +  * {{dig:jre-6u24-windows-i586.exe|Java Runtime Environment (JRE) installer}} - needed to run the IDE
 +
 +
 +===Linux===
 +
 +  * {{:dig:arduino-1.0.5-linux32.tgz|x86}} or {{:dig:arduino-1.0.5-linux64.tgz|x64}} Arduino Studio IDE zip linux archives.
 +  * {{:dig:ftdi_sio_x86.tar.gz|x86}} or {{:dig:ftdi_sio_x64.tar.gz|x64}} FTDI drivers
 +  * {{dig:jre-6u24-linux-i586.bin|Java Runtime Environment (JRE) shell installer}}
 +  * {{dig:jre-6u24-linux-i586-rpm.bin|Java Runtime Environment (JRE) RPM installer}}
 +
 +  
dig/uc2.txt · Last modified: 2024/02/29 07:28 by 127.0.0.1