Thursday, June 23, 2011

Timer circuit for Atmel AVR microcontrollers


The assembly that I present today is radically different from conventional programs because it is a programmer "loop", ie although you do not even need to remove the microcontroller to program your application . In addition, the Programmer supports the Atmel excellent programming software that is made ​​freely available to us, and you can find HERE .
This software, running under Windows 95, 98 and Me, supports all programming functions accepted by the Atmel AVR microcontrollers and can work on them with maximum flexibility.
Finally, and this does no harm, the cost of this program is on the order of fifteen euros when he is able to program the full range of Atmel AVR circuits.

This software, running under Windows 95, 98 and Me, supports all programming functions accepted by the Atmel AVR microcontrollers and can work on them with maximum flexibility.
Finally, and this does no harm, the cost of this program is on the order of fifteen euros when he is able to program the full range of Atmel AVR circuits.



Programming circuit or ICSP


Programming circuit, generally known in American literature ISP, which means "in system programming", or ICSP for "in circuit serial programming" appeared some time ago with the "big" programmable logic devices such that the GAL, LCA and other gate arrays. It has since spread to some of the world of microcontrollers including Atmel AVR circuits are included.
This method of programming based on the use of a serial bit special, whether it exists as such in the microcontroller concerned or some of its legs are being diverted from their primary function when the program has place.
In all cases, the general principle is to use a minimum of legs of the microcontroller so that it is possible to program it while it is already in place in the final application, even if it means provided on the last few switches, manual or electronic, to isolate the legs needed temporarily during the programming phase.
In the case of Atmel microcontrollers, serial link used for the programming circuit is the serial synchronous or SPI. It can exist as a real internal resource, as is the case of most "big" circuits of the family in April, or be present only for the programming phase circuit, as is the case for smaller circuits.
This connection uses three lines, whose names are found elsewhere in all microcontrollers with a SPI (Motorola 68HC11 to Microchip 16F876 for example). So we meet:
  • SCK clock that conveys dialogue;
  • MOSI that carries data in line to microcontroller programmer and is therefore used to send the data to be programmed;
  • MISO that carries data in the other direction and is therefore used to read the microcontroller.

    In order to properly control the programming process circuit, you also have access to the reset input of the microcontroller because it is through it that are passed circuits Atmel programming mode circuit.
    An application designed to support the programming circuit of Atmel therefore adopts the block diagram shown above figure. The straps visible in this figure can obviously be done in many ways: regular straps, mechanical switches or electronic switches.


    Programmer circuit diagram

    That said, the diagram of a timer circuit controlled by PC amounts to very little. Indeed, it is mostly PC-side software to generate the proper timing on the lines SCK, MISO and MOSI, and of course, a minimum of adaptation-level circuitry in order to use a standard PC ports.
    The pattern of my program is reduced to what you can find below. It is intended to be connected to the PC parallel port lines which are easy to control by program to generate the necessary timing.
    It does everything and everything in an integrated circuit IC1, which is a 74HC244 or 74HCT244 simple, that is still six times a buffer back into shape for the signals transmitted on the PC printer output before applying the circuit to program in April. And we are sure to have many rectangular signals and avoid random programming.
    This circuit is wired to "amplify" the signal SCK, MOSI and RESET on the one hand, since these are the PC to the microcontroller, and the only MISO signal, the other way, since it will the microcontroller to the PC.



    Note that a section of an LED driver IC 1 from the PC which allows to report, for its ignition, the microcontroller is being programmed and that we should not touch it! Power is taken directly from the scheduler on the application supporting the microcontroller via the diode D1.

    Implementation of the program circuit for Atmel AVR microcontrollers

    I suggest two different circuit boards to get my programmer. Indeed, as it connects to the parallel port, it is possible to connect the PC directly instead of a printer using the cable provided with the Centronics standard model taken to it. It is also possible to use a parallel port reserved for this purpose and then use a cable with standard connectors DB 25. Sizes and pinouts of these connectors are totally different, so I draw from two separate circuit boards which are plotted below in Figure 1 for version Centronics and Figure 2 for the DB version 25.






Signal

DB 25 male


Centronics female

D0

2

2

D1

3

3

D2

4

4

D3

5

5

D4

6

6

D5

7

7

D6

8

8

D7

9

9

/ ACK

10

10

BUSY

11

11

PAPER OUT

12

12

Mass

18-25

19-29


Semiconductors
IC1: 74HCT244 74HCT244 or
D1: 914 1N or 1N 4148
LED: Red LED Resistor ¼ watt 5% unless otherwise
R1: 470 W (yellow, purple, brown)
R2: 100 k W (brown, black, yellow)

Capacitors
C1: 100 nF Mylar

Various
D1: DB 25 male connector 90 ° angled to implement PCB (DB version 25)
J1: Centronics female connector 90 ° angled to implement PCB (version Centronics)
J2: HE 10 connector for flat cable male straight PCB Mounting
Two HE 10 connectors female crimped on ribbon cable
Standard Flat cable 10 conductors (twenty cm)
Support CI: 1 x 20 feet



These circuits are obviously one another as all components of the assembly, including circuit programming connector is a plug for flat cable 10 points. The pinout of this connector, visible against the figure is consistent with what Atmel calls in its most recent documents and is therefore identical to that of commercial programmers.

The achievement is no difficulty following the directions of the figures below, as appropriate. The 74HC244 is essential or HCT244-mounted as in the case of gross error connection, it is at the forefront ...


Instructions

To run this program, it is obviously necessary software. Fortunately, Atmel provides us with an excellent free program that you find on this site under the heading Software . Start decompress the file that contains it, called avr_isp.zip in a temporary directory and then perform any installation program by running the program "setup" appeared during this decompression.
Do not start right away and installed the program because, to work full, it must be able to detect the presence of the programmer. This clearly has to be connected to a PC parallel port on the one hand, and the application containing the AVR microcontroller to program the other. This link is to a piece of ribbon cable 10 conductors whose length should not exceed twenty centimeters in order not to degrade the signal.
On the application, the straps or switches to isolate the lines controlled by the programmer from the rest of it will be open and the application will be turned normally.
You can then launch the Atmel AVR ISP. You will need to first define a new project using the menu "Project". This definition will offer you first choose the type of microcontroller to program and ask you to name your project. You can also the occasion to add to your project various comments optional.
You can then load the software the file containing the program to place into the microcontroller using the "File" menu, under "Load". The contents of this file will become visible in the "Program Memory" and, where appropriate, in the "EEPROM Data Memory" as if the memory load.
Of course you can freely edit any or all of the data if necessary by clicking in the window in question but also and above all you can access all programming functions, reading and verification of the microcontroller via the menu "Program".
The launch of any of these features led to opening a new window showing its smooth, while the LED lights up the controller while it is running.
Subject to having committed any error of wiring and to have properly selected the microcontroller when defining the project, all programming operations, reading and verification must take place without any problems.
Know Before concluding that the pattern of my program is identical in principle to the one supplied with the "Starter Kit" Atmel STK 200. It is also compatible for all software programming and you might find to be presented as self-compatible to the "Starter Kit".

No comments:

Post a Comment

Thematic Links :