Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Atmega32m1 UART

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Memen

Bascom Member



Joined: 06 May 2016
Posts: 13

blank.gif
PostPosted: Sat Nov 09, 2019 3:13 pm    Post subject: Atmega32m1 UART Reply with quote

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
View user's profile AIM Address
EDC

Bascom Expert



Joined: 26 Mar 2014
Posts: 971

poland.gif
PostPosted: Sat Nov 09, 2019 9:46 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 1161
Location: France

france.gif
PostPosted: Sun Nov 10, 2019 11:14 am    Post subject: Reply with quote

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
Arrow 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
Arrow 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 Question

_________________
pleasure to learn, to teach, to create
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5922
Location: Holland

blank.gif
PostPosted: Sun Nov 10, 2019 1:07 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Memen

Bascom Member



Joined: 06 May 2016
Posts: 13

blank.gif
PostPosted: Mon Nov 11, 2019 7:12 pm    Post subject: Reply with quote

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
View user's profile AIM Address
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum