This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Keyfob firmware edits for custom board

Other Parts Discussed in Thread: CC2541

Hi 

I was working with the Keyfob project in the BLE stack on the CC2541 mini dev kit. I recently got custom boards as we needed to add another sensor for our application. I am not sure what edits need to be done to make it work on the custom boards. Do I need to change something in HAL files? ( we moved around the pin connections )

Any directions on how to proceed with this is appreciated.

Thank you

  • You need to change the following portion just like I did in the keyfobdemo.c file as part of the keyfob eww IAR workspace. This is based on registry values for each of the I/O selection (SEL), direction (DIR) and individual pin level assignment (HIGH or LOW).

    P0SEL = 0; // configure Port 0 as GPIO
    P1SEL = 0x40; // configure Port 1 as GPIO, except P1.6 for peripheral function for buzzer
    P2SEL = 0; // configure Port 2 as GPIO
    //P2SEL = 0x01; // configure Port 2 as GPIO, except P2.0 for peripheral function for vibrator

    P0DIR = 0xFC; // Port 0 pins P0.0 and P0.1 as input (buttons), all others (P0.2-P0.7) as output
    //P0DIR = 0x3E; // Port 0 pins P0.0, P0.6 and P0.7 as input (button, electrodes E1/E2), all others as output
    P1DIR = 0xFF; // All port 1 pins (P1.0-P1.7) as output
    //P1DIR = 0xE3; // Port 1 pins P1.2, P1.3 and P1.4 as input, all others as output
    P2DIR = 0x1F; // All port 2 pins (P2.0-P2.4) as output (port 2 has only 5 pins)

    P0 = 0x03; // All pins on port 0 to low except for P0.0 and P0.1 (buttons)
    //P0 = 0xC1; // All pins on port 0 to low except for P0.0 (3-way switch 1st pin) and P0.6/P0.7 (electrodes E1/E2)
    P1 = 0; // All pins on port 1 to low
    //P1 = 0x1C; // All pins on port 1 to low except P1.2 (button) and P1.3/P1.4 (3-way switch 2nd/3rd pins
    P2 = 0; // All pins on port 2 to low
  • Hi,

    Thanks, this would be a good starting point.

    Best wishes
  • Please be sure to mark the thread as answered if your question was answered :)