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

Introduction

The ISP (In System Programmable) of the AVR chips provides a very simpleand 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-insoftware for STK200 compatible programmer. After compiling the source programin C, the Intel-HEX file or ATMEL-ROM file can be downloaded into the chipdirectly. The ISP has only four signal to implement, i.e., MOSI, MISO,SCK, RESET. Many free programmers connecting through PC's serial or parallelport are available. Mostly the programmer's designer developed their ownISP software for DOS, Window, or Linux platform. The popular one is PonyProgby  Claudio Lanconelli. The PonyProg is capable of writingthe HEX code into the chip with many serial protocol. Many downloader circuitscan also easily be used with PonyProg. The evaluation board for AVR chipfrom ATMEL, STK200 is the most referable by many tool developers.As mentioned earlier, the CodeVision also provides the programmer softwarefor STK200 compatible. I have adapted a simple ISP cable with a tristatebuffer and used it with the CodeVision, it's so cool. The simple ISP cableworks very nice with CodeVision.

Build an ISP Cable

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

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

NOTE:


The AT90S8535 Circuit

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


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

Example Program

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

Using CodeVisionAVR's Built-InProgrammer

As mentioned earlier, the CodeVision has a built-in programmer softwarefor STK200 compatible. The easiest way to download the object code into8353 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 Figure1 with PonyProg, selects AVR ISP in SETUP menu. The latest version canbe downloaded at PonyProg.






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



updated 26 August 2543