Bascom and AVR, Set defaults


Setting Bascom defaults.
A fresh Bascom installation on your PC already has lots of defaults set. You already checked or changed some of these settings when you configured Bascom to start TWinAVR after selecting Program/Send to Chip (F4). To modify these setting select Options/Compiler/Chip:

The chip tab allows you to select another AVR controller from the smallest ATTiny to the largest ATMEGA. We selected the AT90S2313 to get started with the led-flasher.
Now if we save the Basic program we are working on, a companion file called the cfg-file is also saved. For the default led-flasher setup the file looks like this
It is a text-file which you can read with any editor (you can also open it in Bascom). The cfg-file contains all settings you selected in the Options/Compiler/Chip window.
This is an easy way to manage Bascom settings. However, if you would send a Bascom source, such as ledflasher.bas to someone else, you must remember to also send the corresponding ledflasher.cfg file.
Another, and for more advanced users perhaps easier way, is to include all important Bascom settings in the Basic program source itself.
It goes like this:

The first line in the text now specifies that we use the AT90S2313 controller by referring to the corresponding 2313 definition file in the Bascom installation directory. The second line specifies a 4MHz clock speed.
The Bascom help (Help/Index, then scroll down a few pages) lists the following '$' keywords:
$ASM			$BAUD			$BAUD1			$BGF			$BOOT
$CRYSTAL		$DATA			$DBG			$DEFAULT		$EEPROM
$EEPROMHEX		$EXTERNAL		$INCLUDE		$LCD			$LCDRS
$INC 				
$LCDPUTCTRL		$LCDPUTDATA		$LCDVFO			$LIB			$MAP
$NOINIT			$NORAMCLEAR	 	$REGFILE		$ROMSTART		$SERIALINPUT
$SERIALINPUT1		$SERIALINPUT2LCD 	$SERIALOUTPUT		$SERIALOUTPUT1		$SIM
$TINY			$WAITSTATE		$XRAMSIZE		$XRAMSTART

Use the Help to read more on these keywords. Some of these keywords will appear further on.
Now, if you send ledflasher.bas to someone else, it will have the important keywords included and the recipient should be able to compile the program without the need for an additional cfg-file.

TOC