no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | atmel:avr-sdk1 [2010/01/21 16:27] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | === AVR-SDK1 and BASCOM === | ||
+ | {{: | ||
+ | |||
+ | == Configuring the BASCOM programmer == | ||
+ | |||
+ | The AVR-SDK1 is a development board manufactured by [[http:// | ||
+ | |||
+ | Fortunately, | ||
+ | |||
+ | These notes are based upon BASCOM Version 1.11.9.1 - do make sure that you have the latest version installed. | ||
+ | |||
+ | Look in the directory where your BASCOM ' | ||
+ | < | ||
+ | [AVR-SDK1] | ||
+ | BASE=$378 ;lpt1 | ||
+ | MOSI=BASE, | ||
+ | CLOCK=BASE, | ||
+ | RESET=BASE, | ||
+ | MISO=BASE+1, | ||
+ | </ | ||
+ | Now save the file and exit notepad. | ||
+ | The above assumes that the programming cable (supplied with the board) is connected to parallel port LPT1 on your PC. | ||
+ | |||
+ | Now, fire up BASCOM and use the ' | ||
+ | |||
+ | {{: | ||
+ | |||
+ | That's it. | ||
+ | |||
+ | == Configuring the Xtal == | ||
+ | |||
+ | The AVR-SDK1 board is fitted with an external 4MHz crystal. However, by default, a Mega8 chip is configured to use its inbuilt 1MHz oscillator. To have the board use its external xtal, we need to use the BASCOM programmer facility to modify the fuse bits. From the 'Lock and Fuse Bits' tab, select the option shown below for the ' | ||
+ | |||
+ | {{atmel: | ||
+ | |||
+ | Then press the 'Write FS' button. | ||
+ | |||
+ | Your board will now operate at 4MHz. | ||
+ | |||
+ | == A test BASCOM program == | ||
+ | Having setup the BASCOM programming facility and having made the xtal modification, | ||
+ | |||
+ | < | ||
+ | $regfile = " | ||
+ | $crystal = 4000000 | ||
+ | $baud = 9600 ' | ||
+ | $hwstack = 32 ' default use 32 for the hardware stack | ||
+ | $swstack = 10 ' default use 10 for the SW stack | ||
+ | $framesize = 40 ' default use 40 for the frame space | ||
+ | |||
+ | |||
+ | Config Pind.2 = Output | ||
+ | Config Pind.3 = Output | ||
+ | Config Pind.4 = Output | ||
+ | Config Pind.5 = Output | ||
+ | Config Pind.6 = Output | ||
+ | Config Pind.7 = Output | ||
+ | |||
+ | Dim I As Byte | ||
+ | |||
+ | Print " | ||
+ | |||
+ | Waitms 500 | ||
+ | |||
+ | Do | ||
+ | For I = 2 To 7 | ||
+ | Toggle Portd.i | ||
+ | Wait 1 | ||
+ | Next I | ||
+ | Loop | ||
+ | |||
+ | End | ||
+ | </ | ||
+ | |||
+ | ===== The Mega168 ===== | ||
+ | Interesting to note that the Mega168 chip will also work with this board. The 168 has twice as much code space as the Mega8, so can be handy. One important point to note when using the 168 - by default, it ships with a fusebit set that enables a chip-wide ' | ||
+ | {{tag> |