Clock Speed/Frequency/Baud Rate/BitsPerSecond relatioship? Please help

Discussion in 'Embedded Systems and Microcontrollers' started by st98, Oct 23, 2012.

  1. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Hi,

    I am trying to figure out how all these are related , or, a formula, to find out the appropriate data rates. I am using a microcontroler with Clock speed of 16MHz. I want to check whether a wireless module operating at 868MHz would be able to sufficiently transmit sensor data over to another module (same type as first one). Actually I am trying to calculate the BitsPerSecond for the module and the MC at any baud rate, or, at the best baud rate. The data are 8bits and I am using 5 sensors, I am not sure about start bit and stop bit?
    Any help would be very much appreciated
    Thank you in advance
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    I see no a priori reason why any of that should be related. The microcontroller can send and receive at a variety of baudrates. It usually does this with a clock that is sixteen times faster than the baudrate. The most common framing format for serial communications is referred to as "8N1" which stands for 8 bits of data, no parity bit, and 1 stop bit. Every framing format starts with a START bit so we typically don't mention it. The wireless RF module is smack in the middle of a cellphone band so you're going to have to give us more information on how you expect to interface the wireless module to the micro controller. The limitation on datarates for RF modules is how wide a signal is allowed in that particular frequency band. For example if you try to put a Gigabit Ethernet signal on your wireless module you are GOING to have a problem. Less hyperbolically, if everyone around you is using narrowband voice and you step in with a wideband FM signal your going to cause problems and might get yourself arrested.

    If you want a definitive answer, then a schematic and links to appropriate datasheets are essential. Otherwise, I'm afraid you're on your own.
     
  3. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Papabravo,

    Thank you for your post.

    I am using Mega 2560 MC with a Shield v2.01
    //details can be found here:

    http://www.atmel.com/Images/doc2549.pdf
    http://www.aeroquadstore.com/AeroQuad_Shield_v2_1_p/aq2-001.htm

    I was supposed to use modules at 2.4GHz but for interference reasons with the RC I need to choose some other frequency band. The only bands I can use are the 868/865MHz.

    Interface will be serial.

    I am trying to figure out what the maximum data rate will be, as the 865LPMHz (better option than 868MHz) module I want to use offers a range of 10Kbps-80Kbps
    //details can be found here:

    //see page7

    http://ftp1.digi.com/support/documentation/90002126_A.pdf

    Obviously, there are factors such as baud rate, bit/sec and frequencies to be considered, this is where I get stuck

    I am willing to connect all the sensors on the board and transmit the serial data through the serial port as fast as possible but I can't calculate how fast that would be and if the wireless I want to use will be efficient for the application

    Thank you for taking the time to read that post
     
  4. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    The question is how Often you want to transmit the data. For example with 80kbaud you are able to transmit 8000 bytes per second, so with five 8bit sensors you can send the whole data up to 1600 times per second. There may be some overhead in the communication, but this should give you the ballpark figures.
     
  5. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Kubeek,

    Thank you for the reply

    I suppose this is something I don't know, but essentially, I would like to send the data as often as possible as I want it as close to as real time data transfer as possible.

    I see that, taking your example, I could transfer 64Kbps which means it would take 1.25x10^-4 seconds for every byte of information?

    What I can't understand is when the system would be considered as real time?

    Is 1600 times per second a good number for real time transmission?

    Thank you for your time
     
  6. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    You have quite and odd conception of what is meant by real time.
    I think that what constitutes a real time data transfer is the delay from one end to the other, not how much data you stuff through the link - the data rate.

    Say you are waiting for something, like a button push. This could happen once a year, but if it gets to the other side in "essentialy no time" I would consider it real time. The value of "essentialy no time" is more or less on you to decide.

    When the communication is duplex, i.e. the control system on the other side responds back to the senor, you need to think about the action -> link delay -> processing delay -> link delay -> reaction type of thing, and how long it can be to still be considered real time.
     
  7. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Ok, I do understand better now, thank you

    I would need to reduce all delays as much as possible I suppose then

    If we leave the processing and reaction delay, what could possibly 'shorten' the link delays?

    Thank you for your time
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    As kubeek has pointed out the minimum delay would be a one way spray and pray operation. The problem comes if you also want reliable delivery. I don't know how much experience you have with RF propagation but there are many types of interference that will prevent your signal from getting through.

    In any kind of sampled data system you get an accurate picture of what the system is doing with a delay. You only care about the delay if you are trying to "close a control loop". Here the definition of real time depends entirely on the requirements of the overall system. If the control output needs to be updated 10 times a second that gives you a window to gather samples, make a decision, and update the output. Saying it needs to be as fast as possible is not really defining your requirements very well. This will of course lead to over-design, waste, and expense. It is your project and only you can define the requirements.
     
  9. st98

    Thread Starter Member

    May 27, 2010
    33
    1
    Thank you both for your interest in replying to theses

    To give you a better idea me and my class mates are going to build a quadcopter aerial vehicle with 4 DC motors,sensors,etc

    The sensors data are crucial for the operation of the vehicle and hence the faster the data are travelling from one point to other the faster we can control it

    Indeed there are many processes to be run through the entire system as we will also use Matlab for image processing and autonomy

    Video data and sensor data will be transmitted to a laptop and from there depending on the data received, certain processes will take place and control commands will be sent back to the MC to mainly control the motors

    The vehicle also will be manually controlled through a RC controller @2.4GHz

    Hence, I need to find a reliable wireless system to do the job and the only frequency bands it can use is the 865-867MHz one

    I am just trying to calculate 'how reliable' the wireless system can be or if the data rates at which is running will be sufficient

    It will be used for sensor and GPS data only as we're using a separate link for the video data

    Thank you for taking the time to read this

    I would appreciate any ideas, commends
     
  10. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    I think that depends on what you need to transmit. The quadcopter should have enough computing power to stay airborne and stable by itself, because I don´t think that the achievable transfer speed and reliability will be enough to do the fine feedback from the ground.
    Since you already need a video link, you could find some digital one and piggyback sensor data onto the video stream. Then the RC controller could be enough to control the quadcopter.
     
    st98 likes this.
Loading...