473,408 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

UART Reception

Hi all,

I am doing some work on UART. the code to recieve data on my UART from Hyperterminal is as follows:

Recieve(Count, Destination)
{
//Monitor the port to recieve data and continously poll the data.
//A data byte recieved will set the LSB in LCR to 1.
//Thus the CPU has safely read the data
do
{
status = Value in LSR & 0x01;
}while(!status);

//Once read copy the value in RBR to the dest
valueAtdest = ValueinRBRregister;

}

Now this particular code skips out the second character 0x0A if its previously accompnaioed by oxoD.
Say for every combination of 0x0D 0x0A the reciev function simple skips the 0x0A character due to which the next incoming meesages get lost.:(

Any help would be welcome

:)
Sundar


}
Oct 18 '06 #1
3 2750
Banfa
9,065 Expert Mod 8TB
Are you sure that it is your code skipping the character and not Hyperterminal deciding not to send it?

In Hyperterminal select

File -> Properties

Then on the properties dialogue select the Settings Tab

Press the 'ASCII Setup...' button

On the ASCII Setup Dialog check the setting of the first option in the 'ASCII Sending' box, 'Send line ends with line feeds'. This should be checked if you want to receive 0x0D 0x0A



And finally if you are building a comms application get yourself a better terminal emulator than Hyperterminal, it is useless.
Oct 18 '06 #2
Thanx Banfa for notifyin on that front. I tried this out and found out the prob. But can u please tell me why this thing wasnt working that way?

And i hve even bigger query. Although i hve a baud rate of 115200 bps, i need to send thru hyperterminal the data at a character delay of 1 ms else which the receiver UART doesnt accept valid data. and this 1 ms delay is costing my application a whopping 30 minutes to send a 100 kb file to the receiver. the code for the reception remains same as it was earlier. can u help me out this time?

:)
Sundar
Oct 18 '06 #3
Banfa
9,065 Expert Mod 8TB
Since you are polling for receive rather than processing a receive interrupt I would guess that some part of the receiving program is holding the receive loop off (i.e. preventing it running) for that time.
Oct 18 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Arnold | last post by:
I want to use python to communicate with UART port in my PC, how can I achieve this? any modules need to be installed? Thanks
3
by: Dabeule | last post by:
Hello, I have to read/write in the UART to transfer bytes through the serial port. I use Visual C++ 6 and Win2000. When I used Win98, the problem was easy : the functions _inp and _outp (or the...
2
by: Petr Jakes | last post by:
Hi, I am trying to set-up communication to the coin change-giver from my Linux box using the Python code. The change giver uses MDB (Multi Drop Bus) serial protocol to communicate with the...
22
by: Sundar | last post by:
Hi, I am trying to communicate with a BlackBox Receiver through UART. Although i m sending a text file to the reciever through Hyperterminal, i want to reduce my dependency on the same. So i...
0
by: Prashant Bhangre | last post by:
Hello, i want to send a string on my PC serial port. Can u please guide me how can i write a code for that in Python script. I am using Python 1.5.2 version. Plz suggest
4
by: alphatommy_at_hotmail_dot_com | last post by:
Hi, I need to read data coming from serial port of type ushort(16-bits, unfortunately this can not be changed). I have tried reading using ReadChar (32-bits) and ReadByte(8 bits) with no...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.