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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/03/03 05:57
Read: times


 
#40512 - RE: reseting clock from serial port
Responding to: ???'s previous message
The information provided in the section Serial Communication in the tutorials should give you some ideas on how to receive data.

Using an RS232 port seems to be the most likely solution, both from a financial point of view and from the software-side of things. If you want to make the controller 'receive only' you don't even need to use a tru RS232 driver chip; a hand-full of resistors, diodes and a transistor will do the job just as well. If you stroll around on the Internet you will find lots of solutions for that purpose.

The three things remaining then are:

1. You have to define some sort of protocol for yourself to transfer the data from your PC to the clock unambiguously (even if the amount of data you transfer is quite small).

2. You will need to decide how to prepare the data on your PC. In your posting you suggest that you might write some Win98 code in assembly. I can't believe you seriously mean that... To my hunble oponion, a better solution would be to use just a simple terminal emulator (like Hyper Terminal, provided with Win98) and - see 1 - type in the time manually.

3. Write some 8052 code - using the information provided in the tutorials section - to gather the incoming data, check it, process it, preload your clock registers and continue counting.

From your clock-code I do see the reason why you want to be able to set the time. My first step would be to make the timing more accurate so that there is less need to adjust the time in the first place. Moreover, if your design is mains-powered, your clock is bound to spend the rest of its days near your PC - unless you have a long serial port extension cable ... or a laptop, of course.

In other words: adjusting your clock from your PC by means of serial communication seems a bit strange. I would rather add some push-buttons to your clock-design (would you buy a bed-side alarmclock if you needed a PC to set the time? I definately wouldn't!). If this is all related to 'learning how to do serial communications', it would be better to first have your clock send data over the serial port to you PC. Once you have that part up and running, you could try it the other way around ...



List of 12 messages in thread
TopicAuthorDate
reseting clock from serial port            01/01/70 00:00      
   RE: reseting clock from serial port            01/01/70 00:00      
      RE: reseting clock from serial port            01/01/70 00:00      
         RE: reseting clock from serial port            01/01/70 00:00      
            RE: reseting clock from serial port            01/01/70 00:00      
   RE: reseting clock from serial port            01/01/70 00:00      
      RE: reseting clock from serial port            01/01/70 00:00      
      RE: reseting clock from serial port            01/01/70 00:00      
         RE: reseting clock from serial port            01/01/70 00:00      
            RE: One serious problem with this.            01/01/70 00:00      
               RE: You still need interrupts.            01/01/70 00:00      
                  RE: The site. Waqar:            01/01/70 00:00      

Back to Subject List