Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/07/09 08:58
Read: times


 
#165130 - The serial port don't need to know what you transfer
Responding to: ???'s previous message
Would you care to post a reason for compiling this code with Keil and run it on a 805x processor, unless the processor will get real measurements from somewhere, so it will have any reason for computing any information?

Running with static input would mean that you have static output. And if the PC is sending the input and receiving the output, then this will take many times more time than if the PC computes the answers directly - an 8051 is not a good computation co-processor for a PC.

If what you want to to is to transfer data to and/or from the serial port, then you should read all the excellent information about serial-port communication available in the Tutorials and Code Library sections on this site. The serial port does not know what data that is transmitted, so it isn't important that the serial code knows about your specific algorithm. Either send the data binary, or convert the values to hexadecimal or decimal form for the transmission. If you send in binary form, then you will have to do some form of framing. It would be easiest to use a char pointer that you set to the first byte of the first value you want to send. Then Send a magic byte out to signal the start of a transmission. Then send each byte of the data as two characters - the four high bits and the four low bits of the byte sent separately. At the end, send another magic marker.

This means that the actual data will only use four bits of each transmitted byte. The magic markers should make use of the other four bytes, which allows your PC to synchronize and keep track of where you are in the transfer.

The code is quite simple, and you should be able to figure it out with just a basic knowledge about C, and a visit to the Tutorials and Code Library sections.

List of 36 messages in thread
TopicAuthorDate
help is need            01/01/70 00:00      
   What do you want to solve?            01/01/70 00:00      
   What do you want to do is not clear            01/01/70 00:00      
      clarification of requirements            01/01/70 00:00      
         I am still confused...but here goes            01/01/70 00:00      
            printf writes data on serial port            01/01/70 00:00      
               Not necessarily            01/01/70 00:00      
            reply again.            01/01/70 00:00      
               Some more clarification..try this            01/01/70 00:00      
                  To kiran            01/01/70 00:00      
                     How did you do it?            01/01/70 00:00      
                        explanation            01/01/70 00:00      
                           How to post legible source code            01/01/70 00:00      
                           Please post your actual code.            01/01/70 00:00      
                              abt actual code            01/01/70 00:00      
                                 TC?            01/01/70 00:00      
                                    to andy..            01/01/70 00:00      
                                       Confusing!            01/01/70 00:00      
                                          not to miss            01/01/70 00:00      
                                             Oh no he didn't!            01/01/70 00:00      
                                 I think there is a confusion...            01/01/70 00:00      
                                    reply..            01/01/70 00:00      
                                       Got your point            01/01/70 00:00      
                                       a question and a comment            01/01/70 00:00      
                                          double = double precision float            01/01/70 00:00      
                                             not used it after seeing the effects, thus            01/01/70 00:00      
                                                Good incentive to look at fixed point            01/01/70 00:00      
                           Please explain            01/01/70 00:00      
               But Why Keil??            01/01/70 00:00      
         two dimensional input provided at the ports            01/01/70 00:00      
            simulate the data.            01/01/70 00:00      
               seems that not the real MCU            01/01/70 00:00      
                  to jacksonc ben            01/01/70 00:00      
                     The serial port don't need to know what you transfer            01/01/70 00:00      
   this is obviously not for an embedded app.            01/01/70 00:00      
      Clearly            01/01/70 00:00      

Back to Subject List