xeebot

Is it Better to Change Header or Remap GPIO in my Sketch?

3 posts in this topic

Hello, everyone!

Don't know if @Rei Vilo or @energia would like to make a suggestion, but I hope so! :)

I'm working on a project using the CC3200Mod. The PCB should be ready later this week and I'd like to give the designer a basic firmware file to test it. This was no problem on the launchpad, but after we went over the schematic, we found that the pin layout is very different between the CC3200 and the CC3200Mod. 

Working with launchpads doesn't make a difference, but the PCB doesn't have those ports available, everything is connected to the pin on the chip.

Will I be better off by modifying my pin_energia.h file to represent the CC32000MOD's layout or should I map the individual GPIOs in my sketch?

Current pin_energia.h (matches CC32000 pin out):

const uint16_t digital_pin_to_pin_num[] = {
    NOT_A_PIN,    /*  dummy */
    NOT_A_PIN,    /*  1  - 3.3V */
    PIN_58,        /*  2  - GPIO_03 */
    PIN_04,        /*  3  - GPIO_13 */
    PIN_03,        /*  4  - GPIO_12 */
    PIN_61,        /*  5  - GPIO_06 */
    PIN_59,        /*  6  - GPIO_04 */
    PIN_05,        /*  7  - GPIO_14 */
    PIN_62,        /*  8  - GPIO_07 */
    PIN_01,        /*  9  - GPIO_10 */
    PIN_02,        /*  10 - GPIO_11 */
    PIN_15,        /*  11 - GPIO_22 */
    PIN_55,        /*  12 - GPIO_01 */
    PIN_21,        /*  13 - GPIO_25 */
    PIN_06,        /*  14 - GPIO_15 */   
    PIN_07,        /*  15 - GPIO_16 */   
    NOT_A_PIN,    /*  16 - RESET */
    PIN_45,        /*  17 - GPIO_31 */
    PIN_08,        /*  18 - GPIO_17 */    
    PIN_18,        /*  19 - GPIO_28 */
    NOT_A_PIN,    /*  20 - GND */
    NOT_A_PIN,    /*  21 - 5V */
    NOT_A_PIN,    /*  22 - GND */
    PIN_57,        /*  23 - GPIO_02 */
    PIN_60,        /*  24 - GPIO_05 */
    PIN_58,        /*  25 - GPIO_03 */
    PIN_59,        /*  26 - GPIO_04 */
    PIN_63,        /*  27 - GPIO_08 */
    PIN_53,        /*  28 - GPIO_30 */
    PIN_64,        /*  29 - GPIO_09 */
    PIN_50,        /*  30 - GPIO_00 */
    PIN_17,        /*  31 - GPIO_24 */
    PIN_16,        /*  32 - GPIO_23 */
    PIN_60,        /*  33 - GPIO_05 */
    PIN_62,        /*  34 - GPIO_07 */
    PIN_18,        /*  35 - GPIO_28 */
    PIN_21,        /*  36 - GPIO_25 */
    PIN_64,        /*  37 - GPIO_09 */
    PIN_17,        /*  38 - GPIO_24 */
    PIN_01,        /*  39 - GPIO_10 */
    PIN_02        /*  40 - GPIO_11 */
};

CC3200 pinout:
http://www.ti.com/ods/images/SWAS032F/po_DEV3200_swas032.gif

CC3200MOD pinout:

http://www.ti.com/ods/images/SWRS166/CC3200MOD_Pin_Diagram.gif

Any thoughts or opinions would be very welcome!

Share this post


Link to post
Share on other sites

I would suggest to create your own variant in the variant directory. Then add that variant to board.txt which will make it available in the Energia boards menu.

Be carful with directly modifying the core. If you install a core update through the board manager, you will loose all your modifications. A better way but more complex would be to create your own installable light weight package. Here is an example of a lightweight TivaC package that I put together a while ago. The downside is that you will have to be able to host the .json file somewhere so that you can point Energia to it in the preferences->Additional Boards Manager URLs.

http://energia.nu/packages/package_wrigley_index.json

Robert

Share this post


Link to post
Share on other sites

@energia

Thank you, Robert!

Since this is a variant of the CC3200, I assume I'll add it to:

C:\Users\username\AppData\Local\Energia15\packages\energia\hardware\cc3200\1.0.2\variants\

That should give me a quick stop-gap for making test firmware for the new PCB.

Making a lightweight package is probably the way I'll go, and hosting will not be a problem, I just have to puzzle out what I'm doing :)

I really appreciate the advice!

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