176
Libraries
© 2008 Conrad Electronic
...
...
PortF.7
47
PortG.0
48
...
...
PortG.4
52
6.14.7 Port Example
// Program toggles the LED's on the applicationboard
// alternately every second
void main(void)
{
Port_DataDirBit(PORT_LED2,PORT_OUT);
while(true)
// endless loop
{
Port_WriteBit(PORT_LED2,PORT_OFF);
AbsDelay(
1000
);
Port_WriteBit(PORT_LED1,PORT_OFF);
Port_WriteBit(PORT_LED2,PORT_ON);
AbsDelay(
1000
);
}
}
6.15
RS232
The serial interface can be operated at speeds of up to 230.4 kilo baud. With the functions for the
serial interface the first parameter will indicate the port number (0 or 1). Mega32 does only provide
one serial interface (0), while Mega128 does provide two (0, 1).
6.15.1 Divider
The functions
get a divider value as baudrate parameter. The
baudrate is derived from the processor clock (14,7456 MHz).
According to the Atmel processor handbook the following formula is used to calculate the divider for
a specified baudrate:
Содержание C-Control Pro Mega Series
Страница 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Страница 9: ...VIII Inhalt 2008 Conrad Electronic ...
Страница 10: ...Part 1 ...
Страница 17: ...Part 2 ...
Страница 23: ...Part 3 ...
Страница 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Страница 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Страница 58: ...Part 4 ...
Страница 91: ...82 IDE 2008 Conrad Electronic ...
Страница 92: ...Part 5 ...
Страница 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Страница 136: ...Part 6 ...
Страница 231: ...Part 7 ...
Страница 240: ......