View previous topic :: View next topic |
Author |
Message |
Memen
Joined: 06 May 2016 Posts: 13
|
Posted: Sat Nov 09, 2019 3:13 pm Post subject: Atmega32m1 UART |
|
|
Hi All.
What's wrong?
Config Com1 = 38400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Error : 202 Line : 10 .EQU not found, probably using functions that are not supported by the selected chip [UBRR] , in File : D:\SYNC\SynologyDrive\Development\AVR\ATMEGA32M1\BLINK.bas
Error : 202 Line : 10 .EQU not found, probably using functions that are not supported by the selected chip [UCR] , in File : D:\SYNC\SynologyDrive\Development\AVR\ATMEGA32M1\BLINK.bas
(BASCOM-AVR version : 2.0.8.2 ) |
|
Back to top |
|
|
EDC
Joined: 26 Mar 2014 Posts: 971
|
Posted: Sat Nov 09, 2019 9:46 pm Post subject: |
|
|
Simillar comunicate brings in Tiny13 becauese they dont have USART/UART
Look at the datasheet for your choosen uC. It have CAN but dont have USART I think. |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Sun Nov 10, 2019 11:14 am Post subject: |
|
|
Sorry EDC
I look at the datasheet :
Quote: |
Features
21.1.1. LIN
• Hardware implementation of LIN 2.1 (LIN 1.3 Compatibility)
• Small, CPU efficient and independent Master/Slave routines based on “LIN Work Flow Concept” of LIN
2.1 specification
• Automatic LIN header handling and filtering of irrelevant LIN frames
• Automatic LIN response handling
• Extended LIN error detection and signalling
• Hardware frame time-out detection
• “Break-in-data” support capability
• Automatic re-synchronization to ensure proper frame integrity
• Fully flexible extended frames support capabilities
21.1.2. UART
• Full duplex operation (independent serial receive and transmit processes)
• Asynchronous operation
• High resolution baud rate generator
• Hardware support of eight data bits, odd/even/no parity bit, and one stop bit frames
• Data over-run and framing error detection |
but this UART must be enabled but I don't know how to do it I l looked also the .dat from Bascom it is maybe a pb of LENA bit
maybe someone know how to change it ?
Quote: |
; ***** LINUART **********************
; LINCR - LIN Control Register
LCMD0 = 0 ; LIN Command and Mode bit 0
LCMD1 = 1 ; LIN Command and Mode bit 1
LCMD2 = 2 ; LIN Command and Mode bit 2
LENA = 3 ; LIN or UART Enable
LCONF0 = 4 ; LIN Configuration bit 0
LCONF1 = 5 ; LIN Configuration bit 1
LIN13 = 6 ; LIN Standard
LSWRES = 7 ; Software Reset |
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sun Nov 10, 2019 1:07 pm Post subject: |
|
|
Code: | $regfile = "m32m1.dat"
$crystal = 8000000
$hwstack = 24
$swstack = 16
$framesize = 32
$baud = 115200
Config Clockdiv = 1
Do
Print "Hello world"
If Inkey() <> 0 Then
Print "RX test"
End If
Waitms 500
Loop
|
this is indeed a special uart. this kind of uart is limited supported. use the code above. _________________ Mark |
|
Back to top |
|
|
Memen
Joined: 06 May 2016 Posts: 13
|
Posted: Mon Nov 11, 2019 7:12 pm Post subject: |
|
|
Thank. This is how it works. The only thing is that RX intersects with SPI. Tell me how to configure filtering to receive CAN: 18F 00 00 00 00 00 7F 00 00 |
|
Back to top |
|
|
|