View previous topic :: View next topic |
Author |
Message |
programmista123
Joined: 31 Jan 2018 Posts: 140
|
Posted: Sat Mar 19, 2022 9:37 am Post subject: AVR128DB64 and UARTs numbers [solved]. |
|
|
Hello,
Topic just for other users which are focused on the dataseets mainly
When we look into Bascom AVR Help, we can see remarks for XTINY/MEGAX, COMx - value in range from 1-4. DB64 has 6 UARTs [UART 0 - UART 5].
I tried to use 2nd port (PF4 as TxD) with the config without positive results:
Code: | CONFIG COM2 = 9600 , Mode = ASYNCHRONEOUS, Parity=none, Stopbits=1, Databits=8 , Baud_Offset=none , TXPIN=ALT1_PF4 |
So I changed COM2 to COM3 in config and it's working. COMs numbers are shifted by 1 in compare to datasheet.
Regards,
Przemek
(BASCOM-AVR version : 2.0.8.5 ) |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Sat Mar 19, 2022 11:21 am Post subject: |
|
|
This is typical for Bascom. COM1 is for TXD0/RXD0 and have, for example, Serialin0
TXD1/RXD1 is COM2
Check Help topic "Config Serialin" |
|
Back to top |
|
|
programmista123
Joined: 31 Jan 2018 Posts: 140
|
Posted: Sat Mar 19, 2022 11:30 am Post subject: |
|
|
I know about it, however if you're working with code, schematic and datasheet all the time you can just stuck.
It will be great just to put a reminder into help (not only in serialin) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Mar 19, 2022 11:33 am Post subject: |
|
|
The range is 1-6 for DB series. But also depends on the used processor.
when you use config com with ctrl+space you get automatic a list with available com ports.
The com numbering is because of history. The first processors only had 1 UART. And since the goal was to get close to GW BASIC, it also seemed logical to use the same hardware notation as DOS/WINDOWS.
There the serial channel is named COM1. So the uart/usart was to be opened with COM1.
Later when a second uart was added, atmel named is uart1. The first uart was not named usart0 but just usart.
Only later the registers were named with a starting 0. _________________ Mark |
|
Back to top |
|
|
|