GPC450

GPC450 is nothing more than a very flexible microcontroller (AT90S4433) with a robust power supply, 18 configurable I/O, in-circuit programming and RS232 communications arrangements on board. Combined with a real-time shell written for Bascom-AVR, it is a very flexible and capable control platform. See a picture here.

The combination of GPC450 and Bascom-AVR represents very little wasted effort, from software tool installation and hardware hookup to the bare bones of a working control application, for someone new to microcontroller-based control platforms.

Contact me if you want to purchase a GPC450, and Mark Alberts if you want to purchase Bascom-AVR (free demo is available)

This general purpose controller was designed and prototyped, to support the ELEN450 course (now Mechatronics II : MECN468 ).

GPC450 Quick Start (Bascom-AVR orientated)

  1. Look at the hardware, and flip through the manual, so you know what it is you are dealing with.
  2. Install Bascom-AVR software demo.
    Newest demo version allows 1kB of code, download all the relevant files New_1 New_2 New_Ex New_Help (yes, even demo is supported by vendor)
    An older (unsupported) demo version allows 2kB of code, I have a copy here: Old_1 Old_2 Old_Ex Old_Help
  3. Unzip the files above in the same folder, install Bascom-AVR
  4. Open Bascom-AVR and set it up correctly:
  5. Download, and unzip the real-time shell to be found here
  6. Open RTSH_1_main.bas, and see if it compiles (F7) with no error. If you get an error at this point, go and check if your setup above is correctly done. Note that I have only run the shell on the old demo version of Bascom-AVR.
  7. You could simulate the program by hitting the corresponding Bascom icon. This step is non-essential for now.
  8. Connect the programmer/communicator to the GPC450 using the RJ45 patch cable.
  9. Plug the DB25 connector side of the programmer/communicator into the PC parallel port, and the link the serial port of the PC with the programmer/communicator using the short DB9 patch cable.
  10. Power the GPC450 up appropriately (consult the manual if in doubt). The red indicator light should be illuminated.
  11. Load the binary file to the GPC450, by hitting icon labelled "send to chip" or use F4 key. Use "autoprogram" option.
  12. Open the Bascom terminal emulator, by hitting the relevant icon.
  13. Type something, to see if you can communicate with the GPC450 (since this is one of the functions the shell program provides). If nothing comes back at you, check connections and that all the setup is correct. If you type and you see characters, verify that the GPC450 is generating them by switching the power off and on again. You should get one or two random characters when you do this.
  14. Look at the header instruction material of the real-time shell program. You should start by programming to replace the "{{{{{{.....}}}}}}" in the definition part of the shell, and in the "my program tasks" part of the shell. Never use code here which holds the machine waiting for something - rather set/clear a flag and continuously interrogate it. You will quickly see if your code holds the machine up, if you compile and load it, it will start typing the task demand overflow character "!" continuously to the screen, provided that your serial communications are working.
  15. Ensure that you start from a shell that compiles, make a small modification, then check that it still compiles. You will not successfully de-bug using Bascom if you write your entire program, then start debugging.
  16. Now you are ready to think of your application hardware and software.

    Don't be too ambitious when you program, rather use simple constructs in basic, so that the most efficient assembler is generated. Avoid permanent "Print" statements and long character messages, they chew up space. (you can see how much space your program occupies in "show compile result" in Bascom, look at the ROMIMAGE value (in hexadecimal).

More detailed information

GPC Manuals (notes on usage)

Manual Please contact me if you find any errors or discrepancies.

Programming the GPC450

Programming language

  1. Assembler:
    Atmel offer a free assembler and simulator, see http://www.atmel.com/atmel/products/prod202.htm
    IAR offer a free assembler packaged with their excellent Embedded Workshop project package, see http://www.iar.com (the IAR tools are my choice for any serious AVR work)
  2. BASIC compilers. Several are available:
    Bascom-AVR by Mark Alberts (NL) is the recommended choice, see http://www.mcselec.com. There is also an active development program and lively, well-supported e-mail list you can subscribe to. A bit "closed" (register usage is not common knowledge), but a nice package overall,  including its own development, simulator and de-bugging environment -and there is nothing stopping you from doing in-line assembler to get super performance out of this package. More or less compatible with Qbasic they say, although the front end looks like MicroSoft VisualBasic.
  3. C compilers. There are several vendors of C-programs, from the high-end, ANSI-C and EC++ from IAR (high price too) though to ICCAVR from ImageCraft, to CV from CodeVision. For the serious C programmer (who cannot afford the excellent IAR package), I recommend GCC-AVR, the GNU ANSI C compiler for the AVR range of microcontrollers.
    GCCAVR package can be found at : http://www.avrfreaks.com/AVRGCC/index.php You may need to register with avrfreaks first, to download at any of these links. I also recommend that you download the ELF2COFF conversion patch here, so that you can simulate/de-bug using AVRstudio.

Documentation

  1. AVR software tools, application notes, etc may be found at   http://www.atmel.com/atmel/products/prod23.htm
  2. Data book http://www.atmel.com/atmel/acrobat/doc1042.pdf 
  3. AVR Instruction list http://www.atmel.com/atmel/acrobat/doc0856.pdf

Simulator/de-bugger

A simulator-debugger is a useful tool, get it from Atmel: ftp://www.atmel.com/pub/atmel/astudio3.exe

Programmer software

If you don't like the programmer included with any development environment (e.g. the F4 key functionality in Bascom-AVR), several other programming software packages are available, for example PonyProg by Claudio Lanconelli
http://www.cs.unibo.it/~lanconel/prog.html
Just set it up for AVR-ISP.

Other links and resources

  1. AVRfreaks : http://www.avrfreaks.com you are going to have to register - no big deal.
  2. List of AVR applications (some are quite useful, in various languages)   http://www.hth.com/filelibrary/txtfiles/loaa.txt
  3. Real-time Shell in Bascom-AVR, useful starting point for control or data aquisition applications.