Jump to content
Sign in to follow this  
mnpumar

Keeping Track of Time?

Recommended Posts

I am assuming there is a way to at least detect if the voltage at a certain input pin is zero or not? Does this procedure sound technically possible, or are there more limitations to the mcu's that I'm overlooking?

 

yes, this is basic digital io. just don't mix it up with adc input.

you check whether a pin is HI or LOW (meaning zero volts) by looking at the P1IN or P2IN registers (port 1 and port 2). and since it's digital there is only 0 or 1 (low / hi)

 

so to detect a trigger from the master (assuming a low-hi-low pulse) you would.

assuming your input pin is P1.1

 

while (1) {
 if (PIIN &= BIT1) {    // detect a rising edge (hi)
  while (P1IN &= BIT1);   // wait for falling edge (low)
     // do your led display pin toggling here
 }//if
}//while

 

have not tried the above, i think it's the simplest, u may want to setup an interrupt to capture triggering pulse instead.

 

i don't know about your micro-controller experience, but u should try to implement basic things, see them working and migrate to more advance features.

Share this post


Link to post
Share on other sites

I'm thinking of doing this with charlieplexing instead of 5 microcontrollers. I came up with a design that uses only 15 pins, but unfortunately it seems that the msp430g's are limited to 10. Are there any msp430s with more than 10 IO pins that are also DIP?

Share this post


Link to post
Share on other sites

I couldn't find any >14-pin DIP 430s. TI is supposed to be releasing some 20-pin value-line 430s "soon". :(

 

Have you considered using the 74HC595 8-bit serial-in parallel-out latched shift register? Very cheap, very easy to use. Would only take 3 pins on the 430, and you can chain them for as many outputs as you like (could use with/without charliplexing). gatesphere did a nice demo (available in the "Code Vault" section) that helped me a lot. Daisy-chaining is easy: you just chain the serial out to the next serial in, and connect the other two pins in parallel, the bits just flow from one 595 to the next.

 

-Doc

Share this post


Link to post
Share on other sites

I think I can actually get it down to 10 pins by following this charliplexing example: http://ominoushum.com/life/

 

I post back when i get the right layout down.

 

EDIT: Is it possible to implement NPN transistors into that type of layout so I can use a higher voltage to power the LEDs?

 

Edit2: I attempted to come up with a solution like this:

 

vswitch.png

 

However, when I simulate it, it does not work. My intention was that when V2 (representing the input of the msp430) is 3V, it would output 9V, and when V2 was 0, it would output a connection to ground. Does anyone know why this doesn't work? (the nmos can be replaced by another npn after the inverter).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×