Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

receive and evaluate signs over UART

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

Bascom Member



Joined: 12 Oct 2015
Posts: 4

germany.gif
PostPosted: Mon Apr 10, 2017 1:34 pm    Post subject: receive and evaluate signs over UART Reply with quote

Please excuse my bad english
I want to receive a signs over the UART and evaluate it.
I currently use this solution (example):

If Usr.rxc = 1 Then
Z = Udr

Select Case Z

Case "3"
Call Up

Case "2"
Call Down

End Select

End If

This is not optimal - not all signs are detected -
i must repeat.
Is there a better solution?

Thanks Andreas

(BASCOM-AVR version : 2.0.7.8 , Latest : 2.0.7.8 )
Back to top
View user's profile
Duval JP

Bascom Member



Joined: 22 Jun 2004
Posts: 923
Location: France

france.gif
PostPosted: Mon Apr 10, 2017 2:40 pm    Post subject: Reply with quote

read the help and try the sample about serial
learn about Ascii code

Buffer ?
Speed of your program $baud ?
etc..
JP
Back to top
View user's profile Visit poster's website
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Mon Apr 10, 2017 2:54 pm    Post subject: Some communication improvements.. Reply with quote

If I understand your question correctly:

Check how the wireless serial ESP-module is connected to the Arduino Mega 2560 and not missing any character on the Weatherstation. Using a serial buffer, reading complete lines finished with CR/LF. The exchange of 'pure ASCII-characters' at 9600 baud.

Perhaps an idea?
Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
Paulvk

Bascom Member



Joined: 28 Jul 2006
Posts: 1192
Location: SYDNEY

australia.gif
PostPosted: Tue Apr 11, 2017 11:43 am    Post subject: Reply with quote

Hello Andreas

I wrote this program
it sends a command to a solar inverter
it receives data back and works out what is sent
This may help you
https://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=13341

Regards Paul
Back to top
View user's profile
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