View previous topic :: View next topic |
Author |
Message |
Pzx
Joined: 05 May 2015 Posts: 39
|
Posted: Tue May 05, 2015 9:49 pm Post subject: Two different $timeout values for COM1 and COM2 in ATMEGA128 |
|
|
Hello,
I would like to have two different $timeout values for hardware COM1 and COM2 in Atmega 128.
Is it somehow possible?
I use BASCOM AVR 2.0.7.8
Thanks in advance for your help
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Wed May 06, 2015 7:58 pm Post subject: |
|
|
the way to do it :
$timeout=100000
input #1,S 'get some string data from COM1
'before using it on COM2 , just change the timeout
$timeout=400000
input #2,s 'longer timeout on COM2
so basically, you need to define the timeout before using the UART. _________________ Mark |
|
Back to top |
|
|
Pzx
Joined: 05 May 2015 Posts: 39
|
Posted: Fri May 08, 2015 10:17 pm Post subject: |
|
|
Thanks Mark for your prompt answer.
Maybe I was not very clear in my previous post, so let me explain the issue a little bit longer.
I am using two different interrupts for reciving data from COM1 and COM2.
COM1 is configuered for 1200 Bauds (radio remote control) and COM2 for 115200 Bauds (bluetooth)
In both cases the data lengh can varry, so I use $timeout to quickly return from the interrupt and I would like to return really fast.
I dont know whitch COM will receve data, so I am not able to preconfigure $timeout in advance in the way You explained.
Can I have dedicated $timeoutCOM1 and $timeoutCOM2 regardless the expexted recived data order? |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat May 09, 2015 1:45 pm Post subject: |
|
|
I still do not get it.
you best post a small sample that demonstrate what you do, and how you want it.
The ISR is from the built in buffered serial or your own ring buffer?
And with input you mean you use INPUT statement, right?
My previous explanation would still be valid : specify $timeout before the INPUT statement. _________________ Mark |
|
Back to top |
|
|
Pzx
Joined: 05 May 2015 Posts: 39
|
Posted: Sat May 09, 2015 11:07 pm Post subject: |
|
|
Thanks Mark, the issue is solved
After some tests I finally got the point. Sometimes you need to repeat it twice |
|
Back to top |
|
|
|