ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 12.06.2025
Просмотров: 8188
Скачиваний: 1
© MCS Electronics, 1995-2007
See also
$CRYSTAL
Example
CONFIG CLOCKDIV = 8 'we divide 8 Mhz crystal clock by 8 resulting in 1 Mhz speed
CONFIG COM1
Action
Configures the UART of AVR chips that have an extended UART like the M8.
Syntax
CONFIG COM1 = baud , synchrone=0|1,parity=none|disabled|even|odd,stopbits=1|2,databits=4|6|7|8|9,clockpol=0 |1
Remarks
baud |
Baud rate to use. Use 'dummy' to leave the baud rate at the $baud |
value. |
|
synchrone |
0 for asynchrone operation (default) and 1 for synchrone operation. |
Parity |
None, disabled, even or odd |
Stopbits |
The number of stopbits : 1 or 2 |
Databits |
The number of databits : 4,5,7,8 or 9. |
Clockpol |
Clock polarity. 0 or 1. |
Note that not all AVR chips have the extended UART. Most AVR chips have a UART with fixed communication parameters. These are : No parity, 1 stopbit, 8 data bits.
Normally you set the BAUD rate with $BAUD or at run time with BAUD. You may also set the baud rate when you open the COM channel. It is intended for the Mega2560 that has 4 UARTS and it is simpler to specify the baud rate when you open the channel. It may also be used with the first and second UART but it will generate additional code since using the first UART will always result in generating BAUD rate init code.
See Also
CONFIG COM2 , CONFIG COMx
Example
'----------------------------------------------------------------------------- |
|
------------ |
: |
'name |
|
'copyright |
: (c) 1995-2005, MCS Electronics |
'purpose |
: test for M128 support in M128 mode |
'micro |
: Mega128 |
'suited for demo |
: yes |
page -325- |