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

Back to Subject List

Thread Closed: Issue successfully resolved

???
10/21/04 06:21
Read: times


 
#79659 - RE: uC to VBfront end
Responding to: ???'s previous message
hi,

How to send the data to PC when 8 switches are connected to Port P0 Assuming that When P0.0 is 1 it should send #30H, P0.1 #31H.....P0.7 #36H?

Here I do neither improve your code nor write mine. I just try to ask you some questions which may light up your programming.

Generally, a switch is connected between a port pin and ground. For native 8051 port 0 is open-drain, so external pull-ups should be used for its pins. Due that said above, could we assume that you said not When P0.0 is 1... but When P0.0 is 0...?

Another question is what should be sent if a couple of switches are pressed simultaneously?

By the way: you need to control switches connected to port 0. But why do you read port 1 then? And why do you write received data to port 0 which switches are connected at?

Last but not least suggestion - search the forum for "debounce". It may be useful for you as well.

Regards,
Oleg

List of 15 messages in thread
TopicAuthorDate
uC to VBfront end            01/01/70 00:00      
   RE: uC to VBfront end            01/01/70 00:00      
   RE: uC to VBfront end            01/01/70 00:00      
      RE: uC to VBfront end            01/01/70 00:00      
         RE: uC to VBfront end            01/01/70 00:00      
      RE: uC to VBfront end            01/01/70 00:00      
   RE: uC to VBfront end            01/01/70 00:00      
      RE: uC to VBfront end            01/01/70 00:00      
         RE: uC to VBfront end            01/01/70 00:00      
      RE: uC to VBfront end            01/01/70 00:00      
         RE: uC to VBfront end            01/01/70 00:00      
            RE: uC to VBfront end            01/01/70 00:00      
            Some more refinements...            01/01/70 00:00      
   RE: uC to VBfront end            01/01/70 00:00      

Back to Subject List