'm writing a code where a intel hex-80 file is send through the hyperterminal..in my code,i decode the hex file,extract the data and write it onto the flash memory....the problem is when i type the hex file through hyperterminal,its workin fine...bt whn i send a file ,many charcaters are missing...pls help...the baud rate is set as 9600....workin on p89lpc915 on keil....
... the one between your ears - you need to think about the symptom(s) you are seeing; think what could be causing them; etc, etc,...
In this case, what do you think is the key difference between typing manually and having a computer send a whole file?
How do you think this would affect the microcontroller?
Hint: What are the constraints that it imposes on the microcontroller to receive and process each character...?
i tried setting the baudrate to 2400...but then nothin s transmitted/receivd...:O
If it works when you type manually, then it can't be the baud rate that's wrong - can it?
Again: think what is the key difference between typing manually, and having a computer send a whole file? It's not the baud rate, is it?!
Think: How would this affect the microcontroller?
what constraints..??help me out plssss...
Are you an extremely fast touch typist? 9600 baud means an ability to send around 1000 characters/second. How many characters / second can you type?
You need to think - for yourself!
Start with the basics: what is the key difference between typing manually, and having a computer send a whole file:
How fast can you type? ie, how long does the microcontroller get between each character when you type manually?
How fast can a computer send? ie, how long does the microcontroller get between each character when the computer sends?
obviously the computer sends super quick than me typing...but wat can i do abt it???if i code a program to simply receiv n transmit a file,it works fine...but when i add the data decoding part,certain characters start missing...i cant use a receive ISR,cos then my flash memory writing part dosnt work since interrupts are disabled there.....
Exactly! Well done!
"but wat can i do abt it???"
Well, you need to keep thinking! These are exactly the types issues that you will always need to address as a fundamental part of any programming task!
Three choices should be obvious:
1. Ensure that you process each character quickly enough to be ready before the next one arrives;
2. Provide some way to quickly store the data as it arrives, so that you can process it later, at your leisure. This is known as buffering.
3. Devise some scheme - or "protocol" - so that the microcontroller can tell the PC when it's ready to receive more data. This is known as Flow-Control or Pacing.
View all questions in Keil forum