FREE OF CHARGE

Theoretical/Practical Course on BASIC

BASCOM AVR Programming

Author: DAMINO Salvatore

wpe1.jpg (4608 bytes)

BASCOM Course - EXAMPLES

BIBLIOGRAPHY

Brief Introduction.

Aim of this course is to give essential programming knowledge linked together to the necessaries technical hardware information needed to correctly handle the card equipped with micro available on the market.

This is the reason why some hardware basic elements are stated and through them it is possible to begin the different experiments.


Bibliography.

Hereunder are listed all Data Sheets links to be addressed to for a profitable use of the different given examples.

- BASCOM AVR - Tech. Literature and DEMO Version -

- Manuale BASCOM AVR English Manual version 1.11.9.1. pdf 18,5M

- BASCOM AVR-Helpfile English Manual version 1.11a. pdf 847K


BASCOM AVR - Course

- Chapter.001 - 1 key and 1 LED Management.

- Example.001 - T1 key and L3 LED Management.

- Ex_001.CFG -

- Ex_001.HEX -

- Chapter.002 - BZ1 and T1 Management.

- Example.002 - BZ1 Buzzer and T1 key Management.

- Ex_002.CFG -

- Ex_002.HEX -

- Example.003 - T1 key, L3 LED and BZ1 Buzzer Management.

- Ex_003.CFG -

- Ex_003.HEX -

- Chapter.003 - T1, L3 and BZ1 Management.

- Example.004 - It generates 1 second time base and blinks on board LED of GMM AM08. It uses a counting loop type DOA=A+1...UNTIL (1).

- Ex_004.CFG -

- Ex_004.HEX -

- Example.005 - Generates 1 second time base and blinks on board LED of GMM AM08. It uses DELAY instruction. (2).

- Ex_005.CFG -

- Ex_005.HEX -

- Example.006 - It generates 1 second time base and blinks on board LED of GMM AM08. It uses WAITMS instruction (3).

- Ex_006.CFG -

- Ex_006.HEX -

- Chapter.004 - Time base generation of 1 second and switch on of on board LED GMM AM08. Counting use with DO.UNTIL cycle type A=A+1.

- Example.007 - It generates 1 second time base and blinks on board LED of GMM AM08 and it generates a pulse sound on BZ1 buzzer. When T1 key is pressed the LED blinking and beep sound happen more frequentIy, about 5 times for each second. Timings are managed with cycles. (1).

- Ex_007.CFG -

- Ex_007.HEX -

- Example.008 - It generates 1 second time base and blinks on board LED of GMM AM08 and it generates a pulse sound on BZ1 buzzer. When T1 key is pressed the LED blinking and beep sound happen more frequentIy, about 5 times for each second. Timings are managed with DELAY instruction (2).

- Ex_008.CFG -

- Ex_008.HEX -

- Chapter.005 - Serial line Management

- Example.009 - Serial line Management. It allows to receive and transmit group of 20 characters.

- Ex_009.CFG -

- Ex_009.HEX -

- Chapter.006 - Programming for generating a simple Calculator for the 4 Operations.

- Example.010 - Calculator for the 4 basic Operations, on serial line. (1). It requires the Operands and Operator and then it shows the result.

- Ex_010.CFG -

- Ex_010.HEX -

- Example.011 - Calculator for the 4 basic Operations, on serial line. (2). It use the temporary result until = key is pressed.

- Ex_011.CFG -

- Ex_011.HEX -

- Example.012 - Calculator for the 4 basic Operations, on serial line. (3). It requires a formula and then it shows its result.

- Ex_012.CFG -

- Ex_012.HEX -

- Chapter.007 - Morse Code Generation. (1)

- Example.013 - It generates Morse Code Letters.

- Ex_013.CFG -

- Ex_013.HEX -

- Chapter.008 - Morse Code Generation. (2)

- Example.014 - Morse code Teaching Program.

- Ex_014.CFG -

- Ex_014.HEX -

- Chapter.009 - Morse Code Generation. (3)

- Example.015 - It generates Morse Messages with saving on internal EEPROM.

- Ex_015.CFG -

- Ex_015.HEX -

- Chapter.010 - Key Management (4x4). (1)

- Example.016 - It manages Keyboard (4x4). It transmits on serial line only 4 pressed keys.

- Ex_016.CFG -

- Ex_016.HEX -

- Example.017 - It Manages Keyboard (4x4). It transmits on serial line all the 16 pressed keys.

- Ex_017.CFG -

- Ex_017.HEX -

- Chapter.011 - Key Management (4x4). (2)

- Example.018 - It Manages Keyboard (4x4). It uses Debouncing technique on pressed keys.

- Ex_018.CFG -

- Ex_018.HEX -

- Chapter.012 - Key Management (4x4). (3)

- Example.019 - It manages Keyboard (4x4). It uses Debouncing and Autorepeat techniques on pressed keys.

- Ex_019.CFG -

- Ex_019.HEX -

- Chapter.013 - LCD Display Management. (1)

- Example.020 - LCD Display Management. It shows received charactersi.

- Ex_020.CFG -

- Ex_020.HEX -

- Chapter.014 - LCD Display Management. (2)

- Example.021 - LCD Display Management. It shows messages, numbers, variables and it sends commands.

- Ex_021.CFG -

- Ex_021.HEX -

- Example.022 - It saves 40 characters Messages on EEPROM and it can recall and show them on LCD display.

- Ex_022.CFG -

- Ex_022.HEX -

- Chapter.015 - LCD Display Management. (3)

- Example.023 - Calculator for the 4 basic Operations through Keyboard and LCD display of GMM TST3.

- Ex_023.CFG -

- Ex_023.HEX -

- Chapter.016 - Sample programs I/O by TIO 16. (1)

- Example.024 - TIO 16 Management. One of the 7 red LED (connected to PA of GMM TST3 = P1 of Mini Module) is turned on from console (PA).

- Ex_024.CFG -

- Ex_024.HEX -

- Example.025 - TIO 16 Management. It performs a Binary count on the 7 red LED (PA).

- Ex_025.CFG -

- Ex_025.HEX -

- Chapter.017 - Sample programs I/O by TIO 16. (2)

- Example.026 - TIO 16 Management. One of the 7 green and yellow LED (connected to PC of GMM TST3 = P3, P4 of Mini Module) is turned on from console (PC).

- Ex_026.CFG -

- Ex_026.HEX -

- Example.027 - TIO 16 Management. It performs a Binary count on the 7 green and yellow LED (PC).

- Ex_027.CFG -

- Ex_027.HEX -

- Chapter.018 - Sample programs I/O by TIO 16. (3)

- Example.028 - TIO 16 Management. It performs a Binary count on the 16 LED (PA + PC).

- Ex_028.CFG -

- Ex_028.HEX -

- Example.029 - TIO 16 Management. The status of the 16 Keys is continuosly displayed on console.

- Ex_029.CFG -

- Ex_029.HEX -

- Chapter.019 - Sample programs I/O by TIO 16. (4)

- Example.030 - TIO 16 Management. By pressing one of the red keys (PA) it is turned on the relative green and yellow LED (PC).

- Ex_030.CFG -

- Ex_030.HEX -

- Example.031 - TIO 16 Management. It Shifts one of the 16 LED in clockwise directio.

- Ex_031.CFG -

- Ex_031.HEX -

- Chapter.020 - Sample programs I/O by TIO 16. (5)

- Example.032 - TIO 16 Management. It Shifts one of the 16 LED in reverse clockwise direction.

- Ex_032.CFG -

- Ex_032.HEX -

- Example.033 - TIO 16 Management. It modulates the light of the 16 LED from turned off to completely turned on, in cyclic mode.

- Ex_033.CFG -

- Ex_033.HEX -

- Chapter.021 - Sample programs I/O by TIO 16. (6) KITT Supercar

- Example.034 - TIO 16 Management. It alternatively shift a LED with drop effect (scanner of Supercar).

- Ex_034.CFG -

- Ex_034.HEX -

- Chapter.022 - Sample programs I/O by TIO 16. (7)

- Example.035 - TIO 16 Management. By pressing one of the red keys (PA) it is activated the relative green and yellow LED, in reverse logic (PC).

- Ex_035.CFG -

- Ex_035.HEX -

- Example.036 - TIO 16 Management. By pressing one of the red keys (PA) it is turned on the relative green and yellow LED, in sequence by starting from the one at the higher distance. (PC).

- Ex_036.CFG -

- Ex_036.HEX -

- Chapter.023 - Timer Management.

- Example.037 - Timer Management (1). It generates a signal of the frequency inserted by console, through Timer, on L2 LED of GMM TST3.

- Ex_038.CFG -

- Ex_037.HEX -

- Example.038 - Timer Management (2). Reflexes Test. It Measures the Time Passed Between the Casual Turn on of a LED and the Pressure of near Button, Through TIMER.

- Ex_038.CFG -

- Ex_038.HEX -

- Chapter.024 - Counter Management.

- Example.039 - Counter Management. It counts the transitions on a Counter input signal and it continuosly shows the value on Console.

- Ex_039.CFG -

- Ex_039.HEX -

- Example.040 - Counter Management. It shows on Console the Frequency of one Counter input signal, as a simple frequency meter.

- Ex_040.CFG -

- Ex_040.HEX -

- Chapter.025 - Servomotors or simply named Servos or Servo. (1)

- Example.041 - Servomotors (A). From menus it is possible to select the 0°, 90° or 180° positions of the motor.

- Ex_041.CFG -

- Ex_041.HEX -

- Example.042 - Servomotors (B). From Console it is possible to select each position from 0° to 200° of the motor.

- Ex_042.CFG -

- Ex_042.HEX -

- Chapter.026 - Servomotors or simply named Servos or Servo. (2)

- Example.043 - Servomotors (A). By acting on two keys (T1 and T2 of GMM TST3) the servo is moved in the two directions. By pressing both keys the motor reach its central position 90° and it generates a beep with Buzzer. It uses BASCOM instructions..

- Ex_043.CFG -

- Ex_043.HEX -

- Example.044 - Servomotors (B). From Console it is possible to select each position from 0° to 200° of the motor. Motor driven by Low Level instructions.

- Ex_044.CFG -

- Ex_044.HEX -

- Chapter.027 - Servomotors or simply named Servos or Servo. (3)

- Example.045 - Servomotors (A). Continuos rotation motor managed with BASCOM instructions. From Console it is possible to select the Speed and Direction of Rotation. (Over 360°).

- Ex_045.CFG -

- Ex_045.HEX -

- Example.046 - Servomotors (B). Continuos rotation motor managed with Low Level instructions. From Console it is possible to select the Speed and Direction of Rotation. (Over 360°).

- Ex_046.CFG -

- Ex_046.HEX -

- Chapter.028 - 93L46A Serial EEPROM ­ Microwire® Communication Protocol.

- Example.047 - Management of serial EEPROM type 93LC46A in Microwire®.

- Ex_047.CFG -

- Ex_047.HEX -

- Example.048 - Management of serial EEPROM type 93LC46A with Messages of maximum 20 characters, from Console.

- Ex_048.CFG -

- Ex_048.HEX -

- Chapter.029 - 25LC040 serial EEPROM ­ SPI® Communication Protocol.

- Example.049 - Management of serial EEPROM type 25LC040 in SPI.

- Ex_049.CFG -

- Ex_049.HEX -

- Example.050 - Management of serial EEPROM type 25LC040 with Messages of maximum 20 characters, from Console.

- Ex_050.CFG -

- Ex_050.HEX -

- Chapter.030 - 24C08 serial EEPROM I2C BUS® communication protocol.

- Example.051 - Management of serial EEPROM type 24C08 in I2C BUS®.

- Ex_051.CFG -

- Ex_051.HEX -

- Example.052 - Management of serial EEPROM type 24C08 with Messages of maximum 20 characters, from Console.

- Ex_052.CFG -

- Ex_052.HEX -

- Chapter.031 - Generation of a Software UART.

- Example.053 - It generates a Software UART with RS 232 serial Drivers. Communication suspends program execution and it is managed with BASCOM AVR instructions.

- Ex_053.CFG -

- Ex_053.HEX -

- Example.054 - It generates a Software UART with RS 232 serial Drivers. Communication doesn't suspend program execution and it is managed with BASCOM AVR instructions plus Interrupt.

- Ex_054.CFG -

- Ex_054.HEX -

- Example.055 - It manages a Software UART with RS 232 serial Drivers, connected to a complete QTP 03 Seial Display or Operator Panel.

- Ex_055.CFG -

- Ex_055.HEX -

- Chapter.029 - 25LC040 serial EEPROM ­ SPI® Communication Protocol.

- Example.049 - Management of serial EEPROM type 25LC040 in SPI.

- Ex_049.CFG -

- Ex_049.HEX -

- Example.050 - Management of serial EEPROM type 25LC040 with Messages of maximum 20 characters, from Console.

- Ex_050.CFG -

- Ex_050.HEX -

- Chapter.030 - I2C BUS - 24C08 serial EEPROM I2C BUS® communication protocol.

- Example.051 - Management of serial EEPROM type 24C08 in I2C BUS®.

- Ex_051.CFG -

- Ex_051.HEX -

- Example.052 - Management of serial EEPROM type 24C08 with Messages of maximum 20 characters, from Console.

- Ex_052.CFG -

- Ex_052.HEX -

- Chapter.031 - Generation of a Software UART.

- Example.053 - It generates a Software UART with RS 232 serial Drivers. Communication suspends program execution and it is managed with BASCOM AVR instructions.

- Ex_053.CFG -

- Ex_053.HEX -

- Example.054 - It generates a Software UART with RS 232 serial Drivers. Communication doesn't suspend program execution and it is managed with BASCOM AVR instructions plus Interrupt.

- Ex_054.CFG -

- Ex_054.HEX -

- Example.055 - It manages a Software UART with RS 232 serial Drivers, connected to a complete QTP 03 Seial Display or Operator Panel.

- Ex_055.CFG -

- Ex_055.HEX -

- Chapter.032 - DS18S20 Dallas - iButton® devices and 1-Wire® Protocol.

- Example.056 - 1-Wire® BUS management program, that identifies and shows the information on connected devices, by including iButton® models.

- Ex_056.CFG -

- Ex_056.HEX -

- Example.057 - Temperature acquisition through DS18C20 sensor in 1-Wire®.

- Ex_057.CFG -

- Ex_057.HEX -

- Example.058 - Temperature Controller with programmable Control Band and Hysteresys through DS18C20 sensor in 1-Wire®.

- Ex_058.CFG -

- Ex_058.HEX -

- Chapter.033 - Management of an Mini Module on board A/D Converter .

- Example.059 - A/D Converter. One Conversion of a single Analog Input, for each console key pressure.

- Ex_059.CFG -

- Ex_059.HEX -

- Example.060 - A/D Converter. For each key pressure it is performed a sequence of successive conversions of a single Analog Input, and it show the Average.

- Ex_060.CFG -

- Ex_060.HEX -

- Example.061 - A/D Converter. According With Key Pressure, a Series of Conversions are Performed on Available Channels, Single or Repeated, Either With or Without Average.

- Ex_061.CFG -

- Ex_061.HEX -

- Example.062 - A/D Converter. It manages one analog input with programmable control band and hysteresys and it drives an output.

- Ex_062.CFG -

- Ex_062.HEX -

- Chapter.034 - Management of a PWM or a D/A Converter .

- Example.063 - PWM management. It generates a D/A Converter output, obtained by a PWM signal.

- Ex_063.CFG -

- Ex_063.HEX -

- Example.064 -PWM management. It generates a D/A Converter output, obtained by a PWM signal, that continuosly increase and decrease.

- Ex_064.CFG -

- Ex_064.HEX -

- Example.065 - PWM management. It drives a LED by changing its brightness through a D/A Converter output. The D/A line changes according with position of a potentiometer acquired by an A/D Converter.

- Ex_065.CFG -

- Ex_065.HEX -

- Chapter.035 - Management of Relays Output Lines.

- Example.066 - 1 output Relay management. Through the serial communication line, in RS 232, it is driven the status of Relay.

- Ex_066.CFG -

- Ex_066.HEX -

- Example.067 - 2 output Relays management. Through the serial communication line, in RS 232, it is driven the status of Relays.

- Ex_067.CFG -

- Ex_067.HEX -

- Example.068 - 4 output Relays management. Through the serial communication line, in RS 232, it is driven the status of Relays.

- Ex_068.CFG -

- Ex_068.HEX -

- Chapter.037 - CENTRONICS Port and Parallel Port LPT.

- Example.072 - Centronics interface. It prints a text row typed in from console.

- Ex_072.CFG -

- Ex_072.HEX -

- Example.073 - Centronics interface. It prints the characters received from RS 232 serial line, through interrupt storing buffer.

- Ex_073.CFG -

- Ex_073.HEX -

- Example.074 - Centronics interface. It emulates a parallel printer and send the data to print on the RS 232 serial console.

- Ex_074.CFG -

- Ex_074.HEX -

- Chapter.038 - Timer and Counter management from optocoupled Inputs. (1)

- Example.075 - It manages a 32 bits counting line, connected to optocoupled Input.

- Ex_075.CFG -

- Ex_075.HEX -

- Example.076 - It manages four 32 bits counting lines, all connected to optocoupled Inputs.

- Ex_076.CFG -

- Ex_076.HEX -

- Chapter.039 - Timer and Counter management from optocoupled Inputs. (2)

- Example.077 - Bidirectional counter for Encoder sensor acquisition.

- Ex_077.CFG -

- Ex_077.HEX -

- Example.078 - Time and alarm clocks managed through Firmware, by using a Timer.

- Ex_078.CFG -

- Ex_078.HEX -

- Chapter.040 - I2C BUS - Thermometer and Thermostat management through DS 1631 device and I2C BUS interface.

- Example.079 - It measure Temperature through DS 1631.

- Ex_079.CFG -

- Ex_079.HEX -

- Example.080 - It manages a Thermostat through DS 1631.

- Ex_080.CFG -

- Ex_080.HEX -

- Example.081 - It performs a temperature control, complete of Hysteresis band gap, based on DS 1631.

- Ex_081.CFG -

- Ex_081.HEX -

- Chapter.041 - I2C BUS - Real Time Clock management through PCF 8583 device and I2C BUS interface.

- Example.082 - It manages the internal backed RAM of Real Time Clock PCF 8583.

- Ex_082.CFG -

- Ex_082.HEX -

- Example.083 - Base management of Real Time Clock PCF 8583.

- Ex_083.CFG -

- Ex_083.HEX -

- Example.084 - Alarm management of RTC PCF 8583.

- Ex_084.CFG -

- Ex_084.HEX -

- Example.085 - RTC PCF 8583, complete of alarm clock.

- Ex_085.CFG -

- Ex_085.HEX -

- Chapter.042 - RS 232 - I2C BUS - Management of an Operator Panel, type QTP 03.

- Example.086 - It manages a QTP 03 operator panel with RS 232 interface.

- Ex_086.CFG -

- Ex_086.HEX -

- Example.087 - It manages a QTP 03 operator panel with I2C BUS interface.

- Ex_087.CFG -

- Ex_087.HEX -

- Example.088 - It saves and shows a message with horizontal scroll on a QTP 03 operator panel.

- Ex_088.CFG -

- Ex_088.HEX -

- Chapter.043 - I2C BUS - Network management for I2C BUS communications.

- Example.089 - It manages a QTP 03 operator panel together with a DS 1631 Thermometer.

- Ex_089.CFG -

- Ex_089.HEX -

- Example.090 - It manages a QTP 03 operator panel together with a PCF 8583 Real Time Clock.

- Ex_090.CFG -

- Ex_090.HEX -

- Example.091 - It manages visualization on a QTP 03 operator panel together with a DS 1631 Thermometer and a PCF 8583 Real Time Clock.

- Ex_091.CFG -

- Ex_091.HEX -

- Chapter.044 - I2C BUS - Management of a LEDs Driver, model SAA 1064, for 7 segment displays (1)

- Example.092 - It manages two 7 segment LED displays through the driver SAA 1064 and I2C BUS communication.

- Ex_092.CFG -

- Ex_092.HEX -

- Example.093 - It manages four 7 segment LED displays through the driver SAA 1064 and I2C BUS communication.

- Ex_093.CFG -

- Ex_093.HEX -

- Example.094 - It manages a PCF 8583 RTC joined with 7 segment LED displays, through the driver SAA 1064 and I2C BUS communication.

- Ex_094.CFG -

- Ex_094.HEX -

- Chapter.045 - I2C BUS - Management of a LEDs Driver, model SAA 1064, for 7 segment displays. (2)

- Example.095 - It measures the Temperature, through DS 1631 sensor, and it visualizes on 7 segment displays, through SAA 10 61 driver, both with an I2C BUS communication.

- Ex_095.CFG -

- Ex_095.HEX -

- Chapter.046 - DEB 01 - Management of a Keyboard and 7 segment displays.

- Example.096 - It manages a 7 segment LED display. On digit 1 it shows consecutively the 16 hex digits from 0 to F.

- Ex_096.CFG -

- Ex_096.HEX -

- Example.097 - It manages a matrix keyboard, provided of 4x4 keys and it shows the pressed key on the first Display.

- Ex_097.CFG -

- Ex_097.HEX -

- Example.098 - It performs the scanning of a 4x4 keys matrix Keyboard and it shows the pressed keys on 4 digits 7 segment LED Display, with horizontal scroll from right to left.

- Ex_098.CFG -

- Ex_098.HEX -

- Example.099 - It shows on 4 digits 7 segment LED Display the characters received from serial lines.

- Ex_099.CFG -

- Ex_099.HEX -

- Chapter.047 - I2C BUS ­ K51 AVR: Testing board for I2C BUS devices.

- Example.100 - Clock, provided of backup battery, based on PCF 8583 and 7 segment LED Displays, driven by SAA 1064. It includes 3 push button for settings.

- Ex_100.CFG -

- Ex_100.HEX -

- Example.101 - Clock/Alarm, provided of backup battery, based on PCF 8583 and 7 segment LED Displays, driven by SAA 1064. It includes 3 push button for settings, one LED and a Buzzer for visual and audible reports.

- Ex_101.CFG -

- Ex_101.HEX -

- Example.102 - It manages a complete environmental Thermometer/Thermostat based on DS 1631 and 7 segment LED Displays, driven by SAA 1064. It includes 3 push button for settings, one LED and a Buzzer for visual and audible reports. Output is driven directly by hardware.

- Ex_102.CFG -

- Ex_102.HEX -

- Example.103 - It manages a complete environmental Thermometer/Thermostat based on DS 1631 and 7 segment LED Displays, driven by SAA 1064. It includes 3 push button for settings, one LED and a Buzzer for visual and audible reports. Output is driven indirectly by software.

- Ex_103.CFG -

- Ex_103.HEX -

- Chapter.048 - Management of LED Display with 7 and 14 segments.

- Example.104 - It manages a display module, type KND-08, provided of 8 numeric digits on a single row, driven by an M5480 controller.

- Ex_104.CFG -

- Ex_104.HEX -

- Example.105 - It manages a display module, type KND-44, provided of 4+4 numeric digits on two rows, driven by an M5480 controller.

- Ex_105.CFG -

- Ex_105.HEX -

- Example.106 - It manages a display module, type KAD-08, provided of 8 alpha numeric digits on a single row, driven by an M5450 controller.

- Ex_106.CFG -

- Ex_106.HEX -

- Chapter.049 - Management of intelligent LED Displays (1)

- Example.107 - .

- Ex_107.CFG -

- Ex_107.HEX -

- Example.108 - .

- Ex_108.CFG -

- Ex_108.HEX -

- Example.109 - .

- Ex_109.CFG -

- Ex_109.HEX -

- Example.110 - .

- Ex_110.CFG -

- Ex_110.HEX -

- Chapter.050 - Management of intelligent LED Displays (2)

- Example.111 - .

- Ex_111.CFG -

- Ex_111.HEX -

- Example.112 - .

- Ex_112.CFG -

- Ex_112.HEX -

- Example.113 - .

- Ex_113.CFG -

- Ex_113.HEX -

- Example.114 - .

- Ex_114.CFG -

- Ex_114.HEX -

 


Page up-dated at September 01, 2013


homeHome   Es. BAS. K51           Articles