Get Start With Pic, Atmel Microcontroller



1. How to get start with Pic Microcontroller

First, you need to choice the type of development tool, MCU chip for learning. The development tool basically consist of software assembler, hardware programmer and software for the hardware programmer. The software assembler convert the assemble language to hex file. The code of hex file then burn into microcontroller through hardware programmer by software. The software assembler can be find at MPLAB from Pic MCU Manufacture www.microchip.com.You may not need to install all the MPLAB program, however need to install the MPASM program(assembler). For cheap, good and reliable software/hardware programmer can find at www.picallw.com. You can build your own hardware programmer or buy from www.dontronics.com. This software programmer is shareware and can be use for free only on Pic16F84 MCU. Generally, the Pic16F84 MCU chip used for beginner as starting point. You can use any Flash type microcontroller for learning such as Pic16F8X series, Pic16F62X series or Pic16F87X series. Flash microcontroller was choiced due to it electrically erase-able and reprogramme-able through hardware programmer (up to 1000 time). I am perfect using Pic16F628 where the price around same prices as pic16F84 but with more powerful and more peripheral features. I had made the P16PRO hardware programmer shown at following picture. There are also a few free software programmer such as:
  1. propic2 - tried with P16prog hardware programmer(look good)
  2. IC-Prog - tried with Pi6prog, SI-prog hardward programmer (look good).
  3. Pic downloader - not test yet.

For more information, go to the webpage: www.piclist.com. This is good reference site for learning the PIC MCU.
1.a. Start writting assembler code
Use text editor software such as Notepad, Wordpad to write the assembler code and save the file in text format with extention .asm (example: filename.asm). The specific assembler code instruction set can find at www.microchip.com. For medium range of Pic MCU, there is 35 common instructions only (such as Pic16XXX series). The hardware peripheral setting for different MCU may be differ from each other. However, Microchip had provide library set for every MCU which made the setting of peripheral feature and migration of assembler code between different MCU more easy. When using the library set, made sure the hardware setting (data memory) done at correct Bank (came be up to 4 bank for certain MCU). All detail of specification, memory map and instruction set find at www.microchip.com. Use the MPASM software to compile the assembler code to hex code. Then load the hex code into the MCU through suitable software/hardware programmer.
1.b. Simple Pic MCU programming example
The following diagram show the simple example how to program the I/O pin of Pic16F84 or Pic16F628.

Press the button, you will see the LED blinking. Download source code and hex file for Pic16F84 here: F84LED.zip. You can also use Pic16F628 to replace the Pic16F84 where both pins was compatible. You just need to change the library (include list and processor specific variable definitions) from Pic16F84 to Pic16F628. Download source code and hex file for Pic16F628 here: 628LED.zip.

Pic MCU reference

  1. www.piclist.com - pic resource (a lot of pic inforrmation, tutorial, example projects)
  2. www.microchip.com - PIC MCU manufacturer (find all necesssary datasheet and product new here)

2. How to get start with Atmel Microcontroller

Getting start with Atmel MCU almost same as Pic MCU (For flash RISC MCU such as AT90sXXXX series). You can use text editor to writte assemler code and save file with .asm extention or use atmel "software assembler". The software assembler was WAVRASM (window version) find at Atmel webpage (file: ASMPACK): www.atmel.com. The software/hardware programmer can find at www.lancos.com. I had try this software (name: ponyprog) with AT90S2313 flash MCU. The AT90S2313 was compatible with Pic16F628 (both almost had same feature). The hardware programmer (try with SI-prog and STK200) using serial port as interfacing port where power can be directly come from serial port itself without external power supply. This software no only programme Atmel MCU but also other MCU such as Pic MCU, eeprom. I guess this is powerful free software. You can build you own hardware programmer or buy from this website. Atmel had 118 assembly instruction set compare with 35 instruction of PIc MCU , I guess Pic is more easy to learn at beginning state (less confusion). However, AVR MCU may had some other advantage over the PIC16XXX series such as one instruction at one clock cycle campare will 4 clock cycle of PIC. The assembly code size of AVR MCU may be smaller than PIC MCU with the same programming algorithm. Go to the pic microcontroller page pic page for stepper motor project and go to the atmel microcontroller page atmel pagefor stepper motor project, see the different between each other. The flash program memory size of AT90S2313 is 1K word (1024 X 16 bits) or 2Kbyte. The flash program memory of PIC16F84 define as 1K word (1024 X 14 bits) and PIC16F628 as 2K word (2048 X 14 bits). As atmel define 1 word programming code as 16 bits and PIC define as 14 bits size. The simple example as shown on figure.

Download source code/hex file here:blinkLED.zip

Not much reference I found especially free software/hardware programmer for AT90SXXX series. Here is another free software programmer : at-prog.

Atmel MCU reference

  1. www.atmel.com - Atmel MCU manufacturer (find all neceessary datasheet and product new here)
See who's visiting this page.View Page Stats

Go To Home

email : mindtan@yahoo.com