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

Back to Subject List

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


 
#52035 - RE: toggle switches
Responding to: ???'s previous message
I hope this is clear enough.

Yes clear enough that you are asking for un wanted complication.

I can see two things that you need to do :

1. Program the code in to the MCU that you have. But why USB for that ? Do you have a programmer with only a USB port - I doubt. If yes then there is no support needed from us - just read the manual of the programmer. If no try to switch over to a MCU with built in flash. Then you dont need programmers and USB ports.

2. You want to write a program that reads 8 switches and reflects them in 8 LEDS.

If you use one of the five ports ( you said it has five ) for connecting the Toggle switches and another for connecting the LEDs ( via a transistor driver or any other buffer ) then its over.

The pseudo code will be : ( P1 for input and P2 for output)

1.Set all bits of P1 to act as input.
2.Read P1 into Accumulator.
3.Write Accumulator into P2
4.Wait for a small delay of say 100mS
5.Go back to (2)

Hope its clear now.

Raghu


List of 18 messages in thread
TopicAuthorDate
toggle switches            01/01/70 00:00      
   RE: toggle switches            01/01/70 00:00      
      RE: toggle switches            01/01/70 00:00      
         RE: toggle switches            01/01/70 00:00      
   RE: toggle switches            01/01/70 00:00      
      RE: toggle switches            01/01/70 00:00      
         RE: toggle switches            01/01/70 00:00      
   RE: toggle switches            01/01/70 00:00      
   RE: toggle switches            01/01/70 00:00      
   RE: toggle switches            01/01/70 00:00      
      RE: toggle switches            01/01/70 00:00      
         RE: toggle switches            01/01/70 00:00      
            This is getting silly            01/01/70 00:00      
      RE: toggle switches            01/01/70 00:00      
   RE: toggle switches            01/01/70 00:00      
      RE: toggle switches            01/01/70 00:00      
         RE: toggle switches            01/01/70 00:00      
            RE: toggle switches            01/01/70 00:00      

Back to Subject List