We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi everybody,
I actually work on a LPC2103, and I have a problem with a inline assembler.
In fact, I want to modify the Link Register R14, at the end of an interruption, in order to return in Main Programm at an other location.
But when I compile my programm, the compiler print this error:" error #20: identifier "R14" is undifined.
The problem is that I don't know how you can declare this kind of register.
thank in advance
Chris
Not relevant to the question but "I actually work on a LPC2103" should better be worded as "I'm working on LPC2103 (at the moment)".
No offence, we all have language difficulties (and I'm not a native English speaker either).
The English 'actually' is not equal to French 'actuellement'. When I worked in France I was often puzzled with such a use of 'actually' by my French colleagues until another French guy, whose English was quite good, explained this common mistake to me.
tum_
You seem to have made the wrong approach. You want to solve something simple by figuring out the most advanced solution possible.
Whenever you request help with something on a forum, always write a LONG descriptive question, to make sure that the answer you get is a good answer - and not the answer you assumed that you wanted.
We are talking about serial communication. That means that the main loop somewhere has a handler for serial data in and out.
Let your interrupt set a flag.
Let your serial handler look at the flag. If set, clear all pending input (if you are using a receive queue) and any pending output (if you are using a transmit queue) and set your state variables as expected.
If your receive processing isn't a state machine, but a number of nested functions or for/while loops, let them break, return or whatever if the flag is set.
When the main application code is prepared for handling new data, clear the reset flag and start process any new data from the serial port.
Another thing: Unless the data have a specific format that you can not change, I would recommend to design the data format so that the user doesn't have to press a reset button. Let the data start with a "magic" character - then your application can watch the data stream and immediately resynchronize.
That is the reason why most communication protocols normally are line-based if an end user is expected to input the data, or is using specific start-of-frame and end-of-frame characters if a machine is expected to send the data. How fun would it be if you had to press a "reset" button on your computer whenever you want the command-line prompt to know that you are ready to input data?
Thank a lot for all your answers!!!
I saw that I had the wrong approach of my problem, and you allow me to see it.
thanks and "bonjour de France"
I saw that I had the wrong approach of my problem, and you allow me to see it.<p>
Wow ... that was fast and easy. Good luck with your program !
Usually, your question pops up in this forum at least once a month, and will usually result in the original poster becoming quite angry at everyone else and that they're so mean and don't tell him how to turn his simple program into a true nightmare to debug and maintain. (And on top of that, the original poster seems to be working with an 8051-type chip in most cases, which is even more unsuited for this type of hack than an ARM chip).