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, can anyone tell me how i would set up a variable that expects a certain amount of data to be received through rs232.
i.e. to receive 18 bytes of data only once the the rx pin has been set to input.
thanks guys
once you are doing 'special stuff' I suggest you do not use the 'standard' stuff such as getchar.
a routine to receive UART data is about 10 lines in the ISR and about 5 lines in the main.
Why do you not want to receive whatever comes in on the Rx?
forget about bits, the UART handles bytes
Erik
because what comes through the UART is the data from the sesor board of the weather station, i.e. the temperature, pressure etc which is placed on a rooftop. this comes to my transmitter through UART which i then have to transmit to the receiver which outputs this data to an ethernet board that is connected to the database. I agree getchar is not great...but im unfarmiliar with embedded c and need some basic direction.
There is example code in the Support section of this website (see Downloads), and it's also in the Examples folder in your PC installation.
Reading list: http://www.keil.com/books/8051books.asp www.8052.com/books.phtml
The ACCU (Association of C & C++ Users) also has a whole load of book reviews - including a section on embedded:
brian.accu.org/.../