Tuesday, May 6, 2014

In my case just such a mistake occurred. It happened because I used ATmega168 p, while in the progr


The first part has been described "zhelezyachnye" component: the peculiarities of its design and production. Today's post describes the steps to prepare the Arduino development environment and complete testing module manufacturer. To work with the production of the modules require any ISP-programmer. I will use the existing USBtinyISP, you can use the same or any other (for example, do ArduinoISP of existing Arduino board). I recall that in the finals the previous post we got fully assembled device - all the components are in place. Now you need to test the results. Checking MK easiest way to do this: connect the programmer and read the values g switch of fuse bits. As the post is aimed at beginners, I will use visual tools and show you how to do it as simply as possible: we will use GUI Avrdude-GUI. Download the package Avrdude-GUI link. Unpack the resulting archive into a folder. Run avrdude-GUI. Following these simple actions will appear like:
Now you need to make minimum settings: select used programmer g switch (Field Programmer), the port number (Port), is used to specify the MC (Device). Now connect to a computer programmer, and the programmer - to our board. In the section Fuse push the button Read . If done correctly - in the appropriate fields will fuse bits values:
To remedy the situation, g switch turn off the board from the programmer and very meticulously check the soldering quality: g switch fine needle check how well soldered all legs MC through a magnifying glass otsmatrivat suspicious places prozvanivatsya circuit tester from ISP connector to MC, check the power supply. 2. Correctly selected the type of MC. The error message will look something like this:
In my case just such a mistake occurred. It happened because I used ATmega168 p, while in the program chose ATmega168. These chips as close as possible, but they have different signature than the system of carefully reported. The program prompts and problem solving - check correctly selected chip or disable signature verification (by adding the "-F" in the Command Line Option ). I took it the second solution (in this case it is absolutely normal). It would be, of course, open the file and add there avdude.conf information ATmega168p, but leave it on my conscience. Using the same shell can be written and necessary fuse bits. In this case, you need to provide the MC from the internal oscillator at 8MHz. To this can be used to ATmega168p those values that are shown in the screenshot above. Fuse bits "explain" the MC mode in which it should work. On what values need to register (or comprehend the meaning of the above), you can use "calculator fuse bits AVR , which is available, for example, on this page. We can now proceed to the next step to check the possibility of programming and testing the rest of the MK "periphery" on the board. g switch Preparing development environment for this should take another preparatory step necessary to create the appropriate environment Arduino "payment". g switch This is done as follows: you need to open the file with a text editor boards.txt, which is inside the folder \ ARDUINO \ hardware \ arduino, where ARDUINO - the root folder, which is the development environment. g switch In this file, add the following lines: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # s168po8.name = Sensor168p (int8MHz, 1.8V) s168po8.upload.protocol = arduino s168po8.upload.maximum_size = 14336 s168po8.upload.speed = 19200 s168po8.bootloader.low_fuses = 0xe2 s168po8.bootloader.high_fuses = 0xde s168po8.bootloader.extended_fuses = 0x00 s168po8.bootloader.path = atmega s168po8.bootloader.file = ATmegaBOOT_168_pro_8MHz.hex s168po8.bootloader.unlock_bits = 0x3F s168po8.bootloader. lock_bits = 0x0F s168po8.build.mcu g switch = atmega168p s168po8.build.f_cpu = 8000000L s168po8.build.core = arduino s168po8.build.variant = standard # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # The first line indicates the "name card "Then you will choose the programming environment (you can specify any what you like). Special attention to the parameters which describe the fuse bits, type MC and the frequency at which the device will work. Following these simple manipulations can run Arduino environment and make sure that the "new board" appeared in the list of available (in "Tools - Fee" should choose our: Sensor168p (int8MHz, 1.8V)). Test buttons and relays g switch recall that on the circuit design keys to control the relays connected to digital IDUs D3 and D4, and the buttons - analog A1 and A0. Do a simple test to check the proper functioning of the buttons and relays: / / relay int r1 = 3; / / D3 int r2 = 4; / / D4 / / buttons int b1 = 15; / / A1 int b2 = 14; / / A0 void setup () {/ / relay pinMode (r1, OUTPUT); pinMode (r2, OUTPUT); / / Buttons pinMode g switch (b1, INPUT); pinMode g switch (b2, INP

No comments:

Post a Comment