Jump to content
43oh

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.

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

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).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...