DSPRelated.com
Forums

Can I use GPIO inputs to select code to run?

Started by nhtechweenie July 23, 2006
We use the DM642 to display different patterns for board verification.
For now, we use Code Composer to recompile each time we want to
display a new pattern or use a new capture port. We would like to use
GPIO inputs to do this. Is this possible?

Example:
If GPIO_0 = 1, display pattern 1 on video port 2
If GPIO_1 = 1, display pattern 2 on video port 2
If GPIO_2 = 1, pass through video port 1 to video port 2
If GPII_3 = 1, padd through video port 0 to video port 2

If we can do this, can some one please give me a few pointers on GPIO
use to do this?

If we can't do it this way, is there another way to accomplish this?

Regards, Janet
Hello Janet,

The short answer is yes, you can. However, there are some problems with your scenario. What happens if more than 1 GPIO is high?? I would suggest using 3 GPIOs and decode them. Something like:
000 normal operation
001 test 1 - display pattern 1 on video port 2
010 test 2 - display pattern 2 on video port 2
011 test 3 - pass through video port 1 to video port 2
100 test 4 - pass through video port 0 to video port 2
101 test 5 - future test, default to your choice
110 test 6 - future test, default to your choice
111 test 7 - future test, default to your choice

All that you need to do is treat the "value returned by reading GPIO pins & 0xFFFFFFF8" [assuming that you are using GPIO 0-2] as a variable.

,mikedunn
----- Original Message ----
From: nhtechweenie
To: c...
Sent: Friday, July 21, 2006 7:47:49 AM
Subject: [c6x] Can I use GPIO inputs to select code to run?
We use the DM642 to display different patterns for board verification.
For now, we use Code Composer to recompile each time we want to
display a new pattern or use a new capture port. We would like to use
GPIO inputs to do this. Is this possible?

Example:
If GPIO_0 = 1, display pattern 1 on video port 2
If GPIO_1 = 1, display pattern 2 on video port 2
If GPIO_2 = 1, pass through video port 1 to video port 2
If GPII_3 = 1, padd through video port 0 to video port 2

If we can do this, can some one please give me a few pointers on GPIO
use to do this?

If we can't do it this way, is there another way to accomplish this?

Regards, Janet