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.

cc2530 + UART + PWM + Zigbee

Other Parts Discussed in Thread: CC2530, TIMAC, Z-STACK, CC2530EM

Hi all, I´m trying to get PWM signal using cc2530 (SmartRF 05 EB 1.8.1), in other project I did it, but in this project i´m using UART signals to get the value that will generate PWM signal, I´m not sure if the pwm signal is blocked by UART configuration. My configuration is:

T1CTL = 0x02; // Para el controlador
T1CCTL0 = 0x24;
T1CCTL1 = 0x24;
T1CC0H = 0x7; // Máximo conteo con 12 bits del ADC. Periodo de PWM 64us
T1CC0L = 0xFF;
T1CC1L = 0; // Genera la Acción de control a través del PWM
T1CC1H = 0;
PERCFG = 0x40; // Timer 1 saliendo por P1, UART 0 por el P0

U0GCR = 0X08; // Configura los temporizadores para una comunicación a
U0BAUD = 59; // 9600 baudios, con un reloj de 32 MHz
U0CSR = 0XC0; // Configura UART0, habilita la recepción
U0UCR = 0X02; // Configura: sin control de flujo, dato de 8 bits, sin
P0SEL = 0XFF; // P0 función periférico
P0DIR = 0x6F; // b4 y b7 como entradas análogas
ADCCFG = 0X90; // Habilita las entradas análogas 4 y 7
P1SEL = 0X0F; // P1 parte baja en función periférico, ME QUEDO SIN LOS LEDs
P1DIR = 0XF0; // Parte alta de salida
IEN0 = 0X8C; // Habilita las interrupciones de recepción de las 2 UART

// Configuración de los pines del ADC y del Timer 1

HAL_ENABLE_INTERRUPTS();

and then, I activate PWM using this:

T1CC1L = (uint8)(valED >> 8); // Genera la Acción de control a través del PWM, puerto p18, pin 11
T1CC1H = (uint8)valED ;

// ValED has the value of UART

  • Hi Leonardo,

    I don't see any problem with your register settings in terms of Timer1 and UART0. However, I am concerned that IO settings may be harmful if you are using SRF05EB without proper changes on the jumpers because most of the CC2530 IO pins are connected to the built-in components on the board. I would suggest you set P0SEL and P1SEL differently from your original configurations so that only the pins you want to use as non-GPIO function are assigned as 'peripheral'. Also, if pins are configured as GPIO and you don't know to which components those pins are connected on the board, please set the direction of them to 'input' in PxDIR and the input mode to '3-state' in PxINP.

    Please give it a try and let me know if it works. If it doesn't, I will get a HW expert involved in this.

    - Cetri

  • Hi Cetri, I´m a begginer doing this configurations, actually I´m using p1.5 (uart Rx), p1.7 (uart Tx), p18.11 (PWM) - On Board. ¿How can I do to change the ports to work with UART and PWM without change the board pins that I´m using?

  • Hi Leonardo,

    I suggest you seperate yor issue in UART and PWM. You should make UART work first and PWM later. After they both work, you put them together. By the way, may I know which SW you are testing? TIMAC or Z-Stack?

  • Hi Leonardo,

    please make sure that the probe pins on the SRF05 are correctly mapped to the pins of the CC2530EM (and therefore, to the right lines of the chip).

    Please check http://www.ti.com/lit/ug/swru210a/swru210a.pdf, section 6.11 for the table that maps out the RF EM connector lines to the debug probe lines of the SRF05.

    Schematics are included in the above document.

    To understand how the RF EM connector lines on the SRF05 are mapped onto the lines of the CC2530 chip, please check the schematics of the CC2530EM  in http://www.ti.com/lit/zip/swrc144 

    Thanks,

    TheDarkSide