fastAVRlink
Directions for building







Rem: the english language is not my mother tongue so the text below may have some errors or may be unclear. If you want rewrite it, mail me.
 
 

I Features

1.1Functionnal features

- 100% compatible with the Grey TIGraphLink link cable (at 9600 bauds),
- programmable transfer rate but limited to 57600 bauds (up to 6 times faster than the  TIGL),
- 'jumperless': no jumper needed for configuring the transmission speed and/or some other parameters,
- the firmware (program placed within the microcontroller) can be upgraded at any time,
- require either an external power supply, either an external battery (9V),
- should work on Macintosh but untested,
- 'low power' mode (not done yet).
 

1.2 Technical features

- based on an Atmel's  FLASH & RISC microctroller, AT90S2313, with ISP ('In Situ Programming') capability,
- hardware flow control support (CTS/RTS method): may be compulsory over 38400 bds,
- external power supply required (greater than 8V and with 14 to 20 mA) (depending on the crystal frequency: 1.8432 to 10.0 Mhz max or also 11.0592 MHz),
- use low-cost components,
- no specialized programmator needed: embedded,
- any crystal frequency can be used,
- double 32-bytes buffer (adjustable) both in sending and receiving for better performances and a better stability.

Cost: $15 roughly.
 

II Hardware

2.1 Components

Component list (Bill Of Material):

Here ...

The choice of some components is not very critical. The IC1 integrated circuit must be an HC device. No LS, HCT or whatever you want, only an HC one.
About the crystal, any frequency between 1.8432 and 10.0 MHz can be used. You can eventually use a 11.0592 MHz crystal. Nethertheless, the serial baud-rate depends on the crystal frequency. The baud-rate must satisfy a standard requirement: the error ratio should be less than 2%. In practice, it should be less that 1% (more noise then less reliable). You will find a sum-up in the table below:
 


The table above comes from the Atmel's Features.pdf documentation...

At last, higher the frequency is, more supported high data rates are but it requires more current.
To my mind, the better choice is a 9.216 MHz crystal (better performance/consumption/cost ratio) but it is harder to find.
If you can not find it, a 11.0592MHz crystal is almost the better solution because it is very easy to provide but you overclock the microcontroller. Practically, it works very fine !
Anyways, these 2 frequencies have a 0% error ratio.

About the T1 transistor, any NPN one can be used (BC547, ...).
About the regulator, any 5V regulator can be used: 78L05, 7805. If you think supply the fastAVRlink by battery, you should use a low-drop regulator such as the LM2945CT5 which allows you to use your battery longer.
 

2.2 Components resellers

Some addresses:

* AT90S2313: Selectronic (http://www.selectronic.fr) ou Farnell (http://www.farnell.com)
* for the TI connector: RadioSpares (http://www.radiospares.com, http://www.radiospares.fr)
* AT90S2313 and TI connector: Electronique Diffusion (France)

The best: Electronique Diffusion, all components are available.
 

2.3 Accessories

Usually: soldering iron, cutter, voltmeter, and so on.
 

2.4 The printed circuit board (PCB)

You have 2 solutions:
- you can do it yourself,
- you can buy to me by mail.
 

III Building

3.1 The PCB

Think to test any wire of the board...
 

3.2 The circuit

Begin to mount the smallest components and next the bigger ones. It is easier.
Beware with some components: diodes, capacitors. They have a polarity.
In a first time, do not put the IC in their supports (if you have solded supports).

Next, plug the circuit and check that LED is on. If yes, this a right point.
Take a voltmeter and check that power is on (5V on the power pins of IC, between 8 and 14 pins, between  10 and 20 pins).

At last, place IC in their support. Put also the jumper so that the fastAVRlink is in RUN mode.
 

IV The test

Once you have wired you link cable, you have to check that it works. For this, simply launch the small utility called 'avr_prommer(.exe)' and next, toggle the fastAVRlink in PRG mode (jumper removed).
Look at the calibration value and check that value is between 20000 and 40000 roughly (depends on your CPU speed and also the OS). Next, choose the 't' option. A '1E 91 01' sequence should be displayed. If yes then the 'ISP' part of your link cable works !

If a '00 00 00' sequence is displayed: either the serial port is already used by another application (-> reboot), either the fastAVRlink is not in PRG mode (-> remove the jumper) either there is a wiring problem on your circuit (-> check it again).
 

IV The programmation

This step requires to be in PRG mode: you have to be in RUN mode before, next launch the avr_prommer utility, next toggle in PRG mode (jumper removed).

If you have bought a pre-programmed micro-controller, you can skip this step.
Else, go into the 'fastAVRlink' directory of the archive and launch the programmator by 'avr_prommer.exe' (Win32) or './avr_prommer' (Linux).

Check that the programmator is ready by doing a 'test device code' and check that the '1E 91 01' is displayed. If not, quit the utility, re-toggle in RUN mode, and launch again the utility, toggle in PRG mode and relaunch a 'test device code'.

Next, do a 'program flash' and last, do a 'program eeprom'.

For checking that it is all right, do a 'read flash' and/or a 'read eeprom'. The programmator should display something other than a list of 'FF' (erased).
 

V The configuration
 

Factory settings (step IV) are: 11.0592 crystal frequency and baud-rate equals to 19200 bauds.

This step requires the PRG mode: you have to be in RUN mode previously then lauch the utility and next, toggle in PRG mode (jumper removed).
The fastAVRlink is jumperless (I know, there is one !) because it stores all user's parameters in a EEPROM. In order to modify this EEPROM (and so, your settings), a small utility is provided: the ASU ('AVRlink Setup Utility').

The first thing to do is to update the crystal frequency because the ASU use it for calculating the baud-rate.
If you have a 11.0592MHz Xtal, you simply have to type '11.0592'. For a 10MHz Xtal: '10.0'. Don't forget the '.0'.

Next, for your first test, fix up the speed rate to 9600 bauds (Grey TIGL compatible).
 

VI The test of truth !

Two solutions for testing it:
- use the TI software
- use TiLP (formerly known as GtkTiLink) with these settings: 'Grey TIGL/AVRlink'. Do some transfer for testing it.
- use FastLink (support in progress at this time).

If your link cable work, you can now test it at higher baud-rates.
For this, use the ASU and set up the speed as you want that is to say: 9600, 19200, 38400 or even 57600 bauds.
If you feel that the fastAVRlink crashes or freezes (transmission errors, crash), you can work at a lower baud-rate.
At home, it works perfectly at 19200 bauds, almost fine at 38400 bauds. Some other people have no problems at 38400 bauds. It seems that this depends on your calculator type...
 

VII And, if it does not work ?

Think to check your soldering and your wiring.
If you have do your PCB yourself, check also the board.

Personnaly, my AVRprommer has not worked at first time because the resistor on TxD was cut inside !
My Debian packager (JB) has also built the cable herself. It did not work due to a bad soldering.
In conclusion: take the time to check some parts...

Else, in order to help people whose link cable does not work, I provide 2 test programs for verifying that the serial linking works fine. These programs are in the 'test' folder.

There is one for testing sending and the other for testing receiving by an echo program.
Begin by the program located in the 'send' folder. Launch 'a_out.bat' and come back to the root folder in order to launch the programmator.
Next, launch the Terminal program via 'term.bat'. You should see the 'Ok' sentence.

The other program located in the 'echo' folder echoes the character you have typed in the Terminal.

If nothing works, you can eventually mail me (see below).
 

VIII Schematic for curious people

This part is intended for curious people who want understand the schematic of the fastAVRlink...

The schematic seems to be very complex (then expensive for a simple TI-PC link cable) but is very simple in fact.
We can split schematic into 4 parts:
- the power supply: it is placed on the bottom left of schematic. This is a standard and regulated power supply.
Why do I use a power supply ? And the serial port ? Unfortunately, I was not been able to use the serial port for supplying the cable for 2 reasons: it need too power (20 mA) and I have not enough available lines on the serial port for sinking some current (from 10 to 20 mA per lines TxD, DTR, CTS theoritically). Practically, above 6 mA, my serial port decrease !).

- the microcontroller: this is the core of cable. This is an Atmel's RISC microcontroller which have 1Kwords of FLASH EPROM, 128 bytes of RAM and 128 bytes of EEPROM, a watchdog, a serial port and a timer/counter and an analog comparator. It can work up to 10 MHz. It has a very powerful capability: the 'In Situ Programming' that is to say it can be programmed on board via 3 wires.

- the 2 gates at top right (IC1:A and IC1;C) interface the PC serial port with the µC serial port. This interfacing is not very RS232 compliant but it offers a good shaping of signals (noise robustness) and some protection.

- the gate at top right (IC1:B) and the 3 gates at bottom (IC1:D,E,F) implement the ISP mechanism for programming the µC.

- the others: ...
 

--------------
Copyright (c) 2000-2001, Romain Liévin
http://lpg.ticalc.org/prj_tilp
rlievin@mail.com