Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 18:19 18 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MaxiMite COM1 flow-control question...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 08:10pm 21 May 2014
Copy link to clipboard 
Print this post

Hi there folks.

If I enable flow-control(CTS and RTS) on COM1, and connect the pins, do I need to then process the flow-control, or does the MM do all this for me in the background?

Reading the manual, page 47 states that:

  Quote  
The flow control pins (RTS and CTS) use a low voltage to signal stop sending data and high as OK to send. These signal levels allow you to directly connect to devices like the EM-408 GPS module (which uses TTL voltage levels).


In my case, I am about to connect a pager transmitter, which has provision for CTS/RTS, and I am just curious that if I connect these lines, and enable FC on COM1, do I need to do any extra code or will the MM and the pager transmitter work it out between them?
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 08:41pm 23 May 2014
Copy link to clipboard 
Print this post

Now that I have sorted my main serial problem from the other thread, with the help of members here, I give this thread a gentle BUMP!
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 08:59pm 23 May 2014
Copy link to clipboard 
Print this post

It is done by the hardware (whith bitbang serial it is done on the firmware level), no extra programming required.

Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 10:04pm 23 May 2014
Copy link to clipboard 
Print this post

Cool, thanks.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 07:44pm 09 Jun 2014
Copy link to clipboard 
Print this post

I'm just playing with this idea tonight.

According to diagrams freely available on Google Images, CTS and RTS are transposed at each end of the link - just like TXD goes to RXD kind of thing.

Now assuming I have all that correct, how does the MM actually deal with flow-control at the MMBasic level?

What I mean by that, is that if I have several messages to send to the pager transmitter(in my case), and I just print these messages to the com port handler, would I be correct in assuming that this data will just stack up in the serial output buffer, and at which point, the MM and the transmitter will deal with data exchange all by themselves, even if there is more then on message waiting to be sent?

IE: Imagine that I send a message to the transmitter, but it is busy already transmitting something else. With CTS/RTS in use, the TX can signal the MM that it is busy, so to speak, and the MM will hang around till the TX indicates it is ready more more data, at which point, the MM sends it.

Do I have the concept correct?
Does the MMBasic code stop while the flow-control is going on, or does this happen all in the background, and the main code keeps running?

My main concern, is that if the TX is busy transmitting at the time you send it another message, the new message will be dropped. In theory, that WON'T happen, if I connect and use flow-control correctly - yes?Edited by Grogster 2014-06-11
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5923
Posted: 08:54pm 09 Jun 2014
Copy link to clipboard 
Print this post

It would depend a lot on the transmitter.
It might be able to store a number of messages in a buffer or it might use the CTS line to indicate that the message has been sent and it is ready for the next message.

On the Maximite end, provided you don't overflow the tx buffer, no data will get lost.

It should be easy to do a test to see the hardware flow control in action to build up your confidence.

Jim

VK7JH
MMedit   MMBasic Help
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9081
Posted: 09:03pm 09 Jun 2014
Copy link to clipboard 
Print this post

Yes, you are right. I will build a test rig, using a MM, and when I run the test code, I can send two or three messages with about 1 second between messages, so that by the time the 2nd one is being sent to the TX, the 1st one should be in the process of being sent, and this will allow me to see what happens.

So long as I am on the right track, and solid ground with the theory.
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024