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.

RF430FRL152HEVM: Disable JTAG PIN and set PIN 1.5 to normal io output BUT SPI transfer goes wrong

Part Number: RF430FRL152HEVM
Other Parts Discussed in Thread: RF430FRL152H

Hello all,

I am now using RF430FRL152HEVM to communicate with another module that transfers data with the EVM in SPI protocol, in which I use pin1.0 to pin1.3.

Along with communication requirements, that module also needs another pin from MCU(in my project it should be RF430FRL152H) to output high or low level to reset the module. Considering that the RF430FRL152H only has 8 pins, and the left 4 pins are used in JTAG programming(in which way I load my code), I am figuring out how to release one of those pin from JTAG function and turn it into normal io port and output the intended level.

I have implemented my thought with the EVM(master in SPI) and MSP‑EXP430G2ET(slave in SPI), to test whether SPI communication and turning JTAG related pin into normal output port is workable. And I use the MSP‑EXP430G2ET to send received SPI data to the computer via UART.

Here are my code about how to turn pin 1.5 to output io port, and it works well when I use multimeter to test the voltage on pin 1.5.

void JTAGPinHigh(void)
{
asm ( " CALL #0x5CDA "); // Call ROM function ( Initialize function pointers)
asm ( " CALL #0x5CAC "); // Call ROM function ( Check part configuration)
/*P1.4-->JTAG_TCK, P1.5-->JTAG_TDI, P1.6-->JTAG_TDO, P1.7-->JTAG_TMS*/
P1SEL0 &= ~0xF0; //no JTAG
P1SEL1 &= ~0xF0; //no JTAG

P1DIR |= BIT5;//set pin1.5 as output
P1OUT |= BIT5;//set p1.5-TDI high
}

BUT problem comes when I use this function in my 'main' function. If I disable the JTAG function after the SPI communication, the data transmission has no wrong shown on the computer. But if I put this function before the SPI communication, the data shown on the computer is wrong.

In my code, master is sending 0x00 to 0x0F to the slave. The wrong data shows like'C0 57 F8 56 3A 4C 34 5B AC 5C 04 5B 20 59 52 5C ', and it shows up steadily if I restart the communication.

I would like to know how to fix this communication problem if I want to disable JTAG in the middle of my project. I have tried to add 'P1SEL0 |= 0xF0; P1SEL1 |= 0xF0;' to recover JTAG function, but it still shows wrong data.

Thank for your help in advance.

Huaxuan Cai

  • Hello Customer, thank you for your question and interest in our products.

    The forum support of this product has been reduced to first reference our existing documentation and collateral. For support, please take a look to the “Similar Topics” section at the lower right of the thread page. In addition, please consult the existing collateral in the “Technical Documentation” section of the RF430FRL152H product web page along with the Frequently Asked Question document. Alternatively, you can use the search engine of your choice to look for related E2E threads. With each of these resources we believe it will help with your question.

  • Hello Mueller,

    I have searched on the forum to find whether there are similar questions and almost none. I have also searched 'JTAG' in the document 'Frequently Asked Question document' you mentioned, there is no question asking JTAG pin turn into normal io port.

    I have read this post rf430frl152h-how-do-i-lock-the-jtag-on-the-rf430frl152h?,  it mentioned how to lock the JTAG function but doesn't mention whether this lock will interrupt other part in the code or not. And I doesn't lock the JTAG as the way it shows, I just simply change the registers 'P1SEL0' and 'P1SEL1' and the output value on pin 1.5 changed.

    And you mentioned that the forum support has been reduced. What does it mean? Can I receive help by posting my question on this forum after searching the existing resource but no use?

    Thanks a lot,

    Huaxuan Cai