Hello,
I am using the ez430-Rf2500 development kit. I know that the baud rate for this device is fixed for about 9600. I am using the sensor monitor demo code for the device in which it transmits one data of temperature from the end device every second as Its TACCR0 is set to 12000 for 12MHZ clock. Now, I have made some changes in the code which transmits integer from 1 to n but every 0.5ms that is I have set TACCR0 to 6. And i see the data received from the end device on Hyperterminal through access point. So, according to this I should receive 2000 numbers every second to my access point and the same should be displayed on the hyperterminal. But, when i see on the Hyperterminal i only get around 270 numbers in a second and that also the numbers which are shown on the hyperterminal are not continuous like for eg. it displays 2012, 2015, 2017.....in fact it should display 2012, 2013, 2014.....
SO, i dont knw whether its the problem of the hyperterminal (if it is not able to capture the data which is coming so fast) or may be the baud rate problem....
would appreciate if anyone can help me out with this.
Thanks.
Abhishek Trivedi Its TACCR0 is set to 12000 for 12MHZ clock
If you change the count to 6, you'll get an interrupt every 0.5µs or every 6 MCLK cycles. Which is faster than the MSP can enter and exit an ISR, let alone execute some code inside the ISR.
You should instead change TACCR0 to 6000, getting an interrupt every 500µs, and then remove the counter from the ISR, to send something on every ISR call, not every 1000th.
However, sending a 16 bit value every 0.5ms, means 4000 bytes per second. So you'll neet at least a baudrate of 57600. With 9600, you are limited to 960 bytes per second, which limits you to one value every 2.1ms. Which fits the observation of 270 values (=540 bytes) per second due to the missing interrupts caused by the insanely (and unnecessary) high interrupt rate
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
Hello Michael,
Thanks for the reply. I am really sorry, I made a mistake the clock is 12 KHz not 12 MHz. Now should there be any problem of high interrupt rate?
Abhishek TrivediI made a mistake the clock is 12 KHz not 12 MHz. Now should there be any problem of high interrupt rate?
The 12 KHz is my ACLK which is the internal oscillator clock known as VLOCLK. The clock source for my UART is SMCLK which is ~1.1MHz.
I think i got the output as i need. At 9600 we have a limitation of sending 960 bytes per second and I am sending a buffer of 10 bytes(for numbers), so I am limited to 96 numbers per second, so when I set the interrupt rate <= 96(by changing TACCR0) , I get the continuos numbers but when I set it >96, I loose numbers in between. So, i think this whole problem is due to baud rate limitation.
And you are most welcome to tell me if I am wrong in any way.
And can you suggest me any other similar develoment kit with a higher baud rate?
Abhishek TrivediThe 12 KHz is my ACLK which is the internal oscillator clock known as VLOCLK.
Abhishek TrivediThe clock source for my UART is SMCLK which is ~1.1MHz.
Other than that, yes, if you're sending 10 bytes per package, you're limited to 96 interrupts per second. And that you're losing numbers indicates that you're starting to overwrite packets already in the queue, instead of simply slowing down the pace (losing interrupts), which would be the other option.
Abhishek TrivediAnd can you suggest me any other similar develoment kit with a higher baud rate?
The the 4x/2x combo experimenter board has a dedicated RS232 connector supporting all baudrates (you'll need a real COM port or an USB/serial converter to connect to the PC) and the experimenter board for the MSPs with USB controller offers a virtual serial port that is stuffed directly by the MSPs USB controller (but requires much more code to handle).
However, you can connect even teh LaunchPad to the PC with any baudrate by using a separate USB/serial converter. Eithe rone that has an RS232 signal level (the standard type). Then you'll have to disconnect the RX and TX signals from teh FET part of the LaunchPad (pulling the two jumpers) and connect them to a MAX3232 chip or similar. Or you get an USB converter that offers direct TTL signal output. In this case the MAX3232 isn't necessary and RX and TX can be connected directly.
Thanks for your help Michael, I really appreciate it.
Now, I am directly converting numbers from int to char and I am directly transmitting the numbers(not converting to ASCII), So each number takes only two bytes. So, basically with the limitation of 960 bytes, I can send 480 bytes per second. But this is all based on calculation. Is there any way to know how many numbers I receive in each second programmatically? Because right now till whatever number I send, I will eventually receive it but i dont knw whether I will receive it in one second or not?
Can you help me out with this?
Abhishek TrivediIs there any way to know how many numbers I receive in each second programmatically?
Or you start capturing and stop capturign fro a certain period of time and thencount how many numbers arrived in that delay (easier to do, but less precise, of course).
For an MCU, time is relative. If the MCU has no access to a timebase that matches our human 'normal time flow', it cannot tell.
Well, another way would be keepign track of the tiem internally (with a precision crystal as time source). Then count ho wmany values sent and how much tiem passed, itnernally. YOu then have to communicate the result somehow.
I guess, doing it externally on the PC side is the easier way :)