Friday, 2 September 2011

How to start with BASCOMM software.

If you are done with downloading and installation of BASCOMM software,in this post we'll move further.
First appearence of BASCOMM software once after installation.



 Now, go to File then new option and a new file will open where you can write your programs.




After you are  done with this.In BASCOMM programming there are certain code lines which are always required in the beginning of the program.

These lines are as follows:

$regfile = "m16def.dat"
$crystal = 4000000
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7 , E = Portb.3 , Rs = Portb.2
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Config Timer1 = Pwm , Pwm = 8 , Prescale = 1 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down

These lines have very important functionalities like
1. Loading the register files for microcontroller( Atmega16 or Atmega32 )
2. Deciding the clock speed of microcotroller.
2. Configuring some hardwares like:
    LCD,ADC(Analog to Digital Convertor).Timer and microcontroller ports( A,B,C,D) 




For getting better description of each pin of  microcontroller you can go to VIEW option and select PIN LAYOUT and there'll be a popout on extreme right as you can see in above image . Now you can scroll your cursor on each pin of the microcontroller and see description of each pin.
If any query kindly post on the blog.

3 comments:

  1. what is $crystal, Pwm, $regfile="m16def.dat" ?
    please explain..

    ReplyDelete
  2. Hi aredee,
    Thanx for following my blog.
    Luk aredee, $crystal is a register file or you can say its like header file as in C++ which can define the clock speed of microcontroller that is how many commands it canm execute in one second.In above post
    $crystal=4000000(value) defines the clock speed to be 4MHz.
    PWM is Pulse Width Modulation which is used to control the motor speed that i'll explain in my blog later during motor control using microcontroller.
    $REGFILE = "name_of_file"
    $regfile – instruct the compiler to use the specified register file.
    “Name_of_file” - It refers to the name of register file. The register files are stored in the BASCOM-AVR application directory with .DAT extension.
    The register file holds information about the chip such as the internal registers and interrupts addresses.
    Since we are using Atmega16 Microcontroller, we will define
    $regfile= “m16def.dat” ‘this file is loaded for Atmel atmega16
    Note: For Atmega32, we will define $regfile= “m32def.dat”.
    If still you are not clear then mail me from your mail id so that i can gice you some pdf files so that you can understand more acurately.
    Keep bloging and sharing knowledge.
    Thanx aredee

    ReplyDelete
  3. thnks.
    i understand what u said...

    ReplyDelete