Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to capture and store serial communication data in buffers

Status
Not open for further replies.

ruthwik

Newbie level 1
Newbie level 1
Joined
Jun 15, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
9
I sent 1preample and 4bytes in transmitting side , preample contains only 1 and 0 with 4milliseconds delay, each byte contains 8bits with 2milliseconds delay , if a bit contains 1 it will send 1millisecond high and 1millisecond low signal ,and if a bit contains 0 it will send 2millisecond continuous delay, I have a problem at receiving side how to capture and store the preample and 4byte values in a buffer , iam using ARM processor it will update every 5microsecond .. please guide me and give a valuable suggestions

thanks in advance
 

Hi rutwik
Looking at the problem that you are facing, reminds me of one project, that I did long ago when I was learning about controllers. There I was reading Sony SIRC remote data using TSOP. I think a similar algorithm will work for you.
I implement all this using interrupts and timers. whenever there is a change in signal i initiated an interrupt. So say you have recevived a one then as soon as you are at rising edge, you get into a Interrupt routein and start a timer. Now after 1 ms you'll receive another interrupt when your signal goes low. Now you read the timer value. With some calculations you can convert the timer value to real time value. Now after reading the timer you again restart the timer. Now if you receive next interrupt at 1 ms then your next bit is going to be one as well. And if next bit is zero and next to next is 1, then you will read 3ms in your timer.
Now you may ask what if 3-4 consecutive bits are zeros. My suggestion for that will be that on every interrupt you reset a counter which counts till 2 ms. and that will serve your purpose very well.

PS: using interrupts will help you a lot when you are writing a time critical code where every instruction counts. Reading every 5 micro second is basically wasting a lot of resources in your controller.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top