Multiplexing, how to do it right?

Thread Starter

nemuikuma

Joined Apr 4, 2012
7
Hello!
I'm starting out with MCUs ( i have a TI MSP430, because it was the cheapest).
I think I'm getting along fine, but i don't really know how to do multiplexing right code wise.

I have a working program, but i think there are more elegant ways to do it.
I tried to look at other peoples multiplexing code, but usually i couldn't make out anything useful, sometimes because a lot of definition trick me, or sometimes the lack of comment and i couldn't even make out which part is doing the multiplexing.

Can anyone point me in the right direction?

I attached the source code (although the formatting doesn't look that nice as in Code Composer Studio)

One (first strange) problem is that in the debugger the 32Khz crystal does not start, but i guess the debugger is on the same ports, (It's got to be)

Any comment and advice is very welcome! :D
 

Attachments

takao21203

Joined Apr 28, 2012
3,702
I don't know this MCU, but use a dummy software timer to supply it with say 30Khz, or 40 KHz, later replace with actual crystal based timer.

Even if it is 100 KHz you can still test functionality as such.
 

Thread Starter

nemuikuma

Joined Apr 4, 2012
7
I don't know this MCU, but use a dummy software timer to supply it with say 30Khz, or 40 KHz, later replace with actual crystal based timer.

Even if it is 100 KHz you can still test functionality as such.
Thanks, but i already figured it out, but first time i had no idea why it isn't working and took my a while to figure it out that the crystal can't work with the debugger.
But it's not a big problem.
 
Top