Experimenting the AT90S8535 with CodeVisionAVR C Compiler
Wichit Sirichote,  kswichit@kmitl.ac.th
Do a simple experiment using the 8535 chip with the evaluation C compiler, CodeVisionAVR. Build a simple STK200 compatible ISP cable, and a simple 8535 circuit. Write the program entirely in C.


The ISP (In System Programmable) of the AVR chips provides a very simple and very cheap for hobbyist to learn and build application with AVR chips. I have got the evaluation version of CodeVisionAVR, from my friend. The CodeVision is an IDE for AVR chips having built-in software for STK200 compatible programmer. After compiling the source program in C, the Intel-HEX file or ATMEL-ROM file can be downloaded into the chip directly. The ISP has only four signal to implement, i.e., MOSI, MISO, SCK, RESET. Many free programmers connecting through PC's serial or parallel port are available. Mostly the programmer's designer developed their own ISP software for DOS, Window, or Linux platform. The popular one is PonyProg by  Claudio Lanconelli. The PonyProg is capable of writing the HEX code into the chip with many serial protocol. Many downloader circuits can also easily be used with PonyProg. The evaluation board for AVR chip from ATMEL, STK200 is the most referable by many tool developers. As mentioned earlier, the CodeVision also provides the programmer software for STK200 compatible. I have adapted a simple ISP cable with a tristate buffer and used it with the CodeVision, it's so cool. The simple ISP cable works very nice with CodeVision.

Build an ISP Cable

Figure 1 shows a circuit diagram of ISP cable. The 74LS245, an octal tristate buffer provides the float state after the hex code has been written into the chip. Small LED is optional. The 10k resistor pulling pin19 up to +5V will disable all outputs to float state when disconnects LPT1.

Figure 1: Simple ISP cable using tristate buffer 74LS245, LED is optional. The pin connection for ISP signals to LPT1 is compatible with STK200 while the ISP connector is your own circuit whatever the connector you have. There's no protection diode thus be careful when put the ISP connector to 8353 board.


The AT90S8535 Circuit

To do simple experiment, you need only a single chip microcontroller AT90S8535, a regulator IC for +5V supply and an 8MHz X-tal. The others passive components are small resistor, and capacitor.

Figure 2: Simple circuit for AT90S8535. I used only two pins to check program running, i.e., PC7 connects small LED for blinking test with timer0 and OC2 for tone generation by using timer2 with output compare register.

Example Program

Example program,BLINK.C makes LED connected pin PC7 blink every second and generating 558Hz tone output at pin OC2. The hex file is BLINK.HEX.

Using CodeVisionAVR's Built-In Programmer

As mentioned earlier, the CodeVision has a built-in programmer software for STK200 compatible. The easiest way to download the object code into 8353 chip is to use CONFIGURE in Project menu. After project has made, the object code is then be downloaded into the chip directly.

Using PonyProg

PonyProg is a serial device programmer suitable for many serial protocols, say SPI, I2C, Microwire. When use the simple ISP cable shown in Figure 1 with PonyProg, selects AVR ISP in SETUP menu. The latest version can be downloaded at PonyProg.

The author welcomes any suggestion or bug report of using a simple ISP cable with another PC.

updated 26 August 2543