Other Parts Discussed in Thread: CC3100, MSP-EXP430F5529LP, MSP-EXP430FR5969, MSP430FR5969, MSP430FR6989
I have been posting and dialogging with Michael in the CC3100 forum. He suggested I also try this forum.
To Date I have not been able to successfully get the CC3100 to work with the FR6989 launch pad
- Again, my Ultimate goal: Add CC3100 WiFi to my FR6989 products
- Unbelievable that TI or some user does not have a working example.
- I am sure many people would be extremely grateful to have a posted working "WiFi email with CC3100 - FR6989
CC3100_sdk_1.3.0, CCS_8.2.0, Compiler TIv18.1.3.LTS
- Working perfectly with F5529 examples
- I successfully ported my F5529 product to the latest sdk, CCS, and compiler, Working perfectly with my F5529 products
- Working perfectly with FR5969 examples
- To Date I have not been able to successfully port it to have CC3100 work with the FR6989 launch pad
- I have used the FR6989 Out of the Box example (so very simple application to start with) and have tried to add CC3100 WiFi simplelink to it by adding files from the FR5969 example
- As outlined in the documentation in the sdk download: CC3100_sdk porting guide can be found at cc3100-sdk/docs/simplelink_api/html/index.html:
- Per the instructions I have created my own local copy of user.h (not linked to the CC3100_sdk library or since it is a linked file it will change the base file and break all other examples and projects)
- I copied all of the body from the original user.h but then had to change my copy to link to my new copies of 1) board, 2) cli_uart, 3)spi
- The pins and instance of the uarts and spi are different for each of the launch pads (see table below)
- I created boardFR6989.C and .h, cli_uartFR6989.c and .h, spiFr6989.c and .h
- In these files I changed pin numbers and Interrupt vectors to match the FR6989
- To date: I have a clean compile, it runs, I can single step and see it writing to the Back Channel uart buffer by watching the registers, but no characters are displayed on the back channel Uart and the WiFi does not work
This posting provides a link to wiki page which provides working UARTs for these launch pad.
The FR6989 UART works and the code is very well written and documented
https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/465550?help-MSP430FR6989-launchpad-deverlopment-UART
http://processors.wiki.ti.com/index.php/MSP_UART
myUART_05_example.zip …for the FR6989
myUART_5529.zip myUART_5529.zip (MSP-EXP430F5529LP LaunchPad)
myUART_5529.zip myUART_5969.zip (MSP-EXP430FR5969 LaunchPad)
My next step is going to take the working myUART_05_example.zip for the FR6989 and now try to add simplelink to it as at least the back channel UART is proven to work.
I will post my cli_uartFR6989.c code that I modified from the FR5969 CC3100 example….in case someone can spot an easy obvious error
- For the benefit other users this is the mapping of each of the CC3100 WiFi pins to the respective launch pad pin number
- I used tabs, so I hope this is still formatted OK once it is posted
CC3100 CC3100 FR5969 FR6989 F5529
Booster Left Side Left Side Left Side Left Side
Pack Outer Row Outer Row Outer Row Outer Row
VCC 3.3V P1.1 3.3V 3.3V 3.3V
Unused P1.2
UART1_TX P1.3 P2.6 Rx P4.3 Rx P3.4 Rx
eUSI_A1 USCI_A0 USCI_A0
UART1_RX P1.4 P2.5 Tx P4.2 Tx P3.3 Tx
eUSI_A1 USCI_A0 USCI_A0
nHIB P1.5 P4.3 P3.2 P1.6
Unused P1.6
SPI CLK P1.7 P2.2 P1.4 P3.2
eUSCI_B0 eUSCI_B0 eUSCI_B0
Unused P1.8
Unused P1.9
Unused P1.10
CC3100 CC3100 FR5969 FR6989 F5529
Booster Left Side Left Side Left Side Left Side
Pack Inner Row No Header Inner Row Inner Row
Pack Inner Row No Header Circuit Side Circuit Side
5V P3.1 No Header 5V 5V
GND P3.2 No Header GND GND
Unused P3.3
Unused P3.4
Unused P3.5
Unused P3.6
Unused P3.7
Unused P3.8
Unused P3.9
Unused P3.10
CC3100 CC3100 FR5969 FR6989 F5529
Booster Right Side Right Side Right Side Right Side
Pack Outer Row Outer Row Outer Row Outer Row
GND P2.1 GND GND GND
IRQ P2.2 P1.2 P2.1 P2.0
SPI CS P2.3 P3.0 P1.5 P2.2
Unused P2.4
nRST P2.5 RST RST RST
SPI_MOSI P2.6 P1.6 P1.6 P3.0
eUSCI_B0 eUSCI_B0 eUSCI_B0
SPI_MISO P2.7 P1.7 P1.7 P3.1
eUSCI_B0 eUSCI_B0 eUSCI_B0
Unused P2.8
Unused P2.9
Unused P2.10
CC3100 CC3100 FR5969 FR6989 F5529
Booster Right Side Right Side Right Side Right Side
Pack Inner Row No Header Inner Row Inner Row
Pack Inner Row No Header Circuit Side Circuit Side
Unused P4.1
Unused P4.2
Unused P4.3
UART1_CTS P4.4 No Header P3.6 P1.4
UART1_RTS P4.5 No Header P3.7 P1.3
Unused P4.6
NWP_Log_TX P4.7 No Header P1.3 P4.3
NWP_Log_TX P4.8 No Header P3.0 P4.0
Unused P4.9
Unused P4.10
Launch Pad FR5969 FR6989 F5529
Lnch Pad Bck-ch-Uart Rx P2.0 P3.4 P4.4
eUSCI_A0 USCI_A1 USCI_A1
Lnch Pad Bck-ch-Uart Tx P2.1 P3.5 P4.5
eUSCI_A0 USCI_A1 USCI_A1
Lnch Pad Bck-ch-Uart RTS P4.1 P3.1 P6.7
Lnch Pad Bck-ch-Uart CTS P4.0 P3.0 P1.7
//LH 10-11-2018 this is the cli-uart I got from TI Michael Reymond in reply to my post
// I am using it as a base to try and create a working version for the FR6989
// To date this code compiles clean, runs, but does not write to the back channel com port
/*
* cli_uart.c - msp430fr5969 launchpad application uart interface implementation
*
//*****************************************************************************
//
//! \addtogroup CLI_UART
//! @{
//
//*****************************************************************************
#include <cli_uart/cli_uartFR6989LH.h>
#include <string.h>
#include <msp430.h>
//FR5969 use UCA0 but FR6989 uses UCA1
//#define UCA0_OS 1 /* 1 = oversampling mode, 0 = low-freq mode */
//#define UCA0_BR0 17 /* Value of UCA0BR0 register */
//#define UCA0_BR1 0 /* Value of UCA0BR1 register */
//#define UCA0_BRS 0 /* Value of UCBRS field in UCA0MCTL register */
//#define UCA0_BRF 6 /* Value of UCBRF field in UCA0MCTL register */
#define UCA1_OS 1 /* 1 = oversampling mode, 0 = low-freq mode */
#define UCA1_BR0 17 /* Value of UCA1BR0 register */ //Baud rate zero
#define UCA1_BR1 0 /* Value of UCA1BR1 register */ //Baud rate 1
#define UCA1_BRS 0 /* Value of UCBRS field in UCA1MCTL register */
#define UCA1_BRF 6 /* Value of UCBRF field in UCA1MCTL register */
#define ASCII_ENTER 0x0D
//LH 10-16-2018 added this next line as it appears to not be defined, as code skips over it
#define _USE_CLI_ 1
#ifdef _USE_CLI_
unsigned char *g_ucUARTBuffer;
int cli_have_cmd = 0;
#endif /* _USE_CLI_ */
/*!
\brief Application Uart interrupt handler
\param[in] none
\return none
\note
\warning
*/
//TI help posting myUART_05-FR6989 show P2.0 P2.1 are for EUSCI_A0_BASE
//Looking at the launch pad see that it is using P3.4 and P3.5 so EUSCI_A1
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
//#pragma vector=USCI_A0_VECTOR
//__interrupt
//#elif defined(__GNUC__)
//__attribute__((interrupt(USCI_A0_VECTOR)))
//#endif
//void UART_ISR(void)
//{
// switch(__even_in_range(UCA0IV,0x08))
// {
// case 0:break; /* Vector 0 - no interrupt */
// case 2: /* Vector 2 - RXIFG */
//#ifdef _USE_CLI_
// *g_ucUARTBuffer = UCA0RXBUF;
// if (*g_ucUARTBuffer == ASCII_ENTER)
// {
// cli_have_cmd = 1;
// *g_ucUARTBuffer = 0x00;
// __bic_SR_register_on_exit(LPM0_bits);
// }
// g_ucUARTBuffer++;
//#endif /* _USE_CLI_ */
// __no_operation();
// break;
// case 4:break; /* Vector 4 - TXIFG */
// default: break;
// }
//}
//LH 10-16-2018 to use A1 vector
#pragma vector=USCI_A1_VECTOR
__interrupt
#elif defined(__GNUC__)
__attribute__((interrupt(USCI_A1_VECTOR)))
#endif
void UART_ISR(void)
{
switch(__even_in_range(UCA1IV,0x08))
{
case 0:break; /* Vector 0 - no interrupt */
case 2: /* Vector 2 - RXIFG */
#ifdef _USE_CLI_
*g_ucUARTBuffer = UCA1RXBUF;
if (*g_ucUARTBuffer == ASCII_ENTER)
{
cli_have_cmd = 1;
*g_ucUARTBuffer = 0x00;
__bic_SR_register_on_exit(LPM0_bits);
}
g_ucUARTBuffer++;
#endif /* _USE_CLI_ */
__no_operation();
break;
case 4:break; /* Vector 4 - TXIFG */
default: break;
}
}
int
CLI_Read(unsigned char *pBuff)
{
if(pBuff == NULL)
return -1;
#ifdef _USE_CLI_
cli_have_cmd = 0;
g_ucUARTBuffer = pBuff;
//FR5969 use UCA0 but FR6989 uses UCA1
// UCA0IE |= UCRXIE;
UCA1IE |= UCRXIE;
__bis_SR_register(LPM0_bits + GIE);
while(cli_have_cmd == 0)
;
//FR5969 use UCA0 but FR6989 uses UCA1
// UCA0IE &= ~UCRXIE;
UCA1IE &= ~UCRXIE;
return strlen((const char *)pBuff);
#else /* _USE_CLI_ */
return 0;
#endif /* _USE_CLI_ */
}
int
CLI_Write(unsigned char *inBuff)
{
if(inBuff == NULL)
return -1;
#ifdef _USE_CLI_ //LH10-15-2018 it was just skipping this so comment out so must do the code when called
unsigned short ret,usLength = strlen((const char *)inBuff);
ret = usLength;
while (usLength)
{
//FR5969 use UCA0 but FR6989 uses UCA1
// while (!(UCA0IFG & UCTXIFG)) ;
// UCA0TXBUF = *inBuff;
while (!(UCA1IFG & UCTXIFG)) ;
UCA1TXBUF = *inBuff;
usLength--;
inBuff++;
}
return (int)ret;
//#else /* _USE_CLI_ */
// return 0;
#endif /* _USE_CLI_ */
}
void
CLI_Configure(void)
{
#ifdef _USE_CLI_ //LH 10-15-2018 5:23PM when main calls config it just skips over this, why?? so comment out the if
PM5CTL0 &= ~LOCKLPM5; /* Disable the GPIO power-on default high-impedance mode
to activate previously configured port settings */
//FR5969 Uart Pins P2.0 = Tx, P2.1 = RX
//TI help posting myUART_05-FR6989 show P2.0 P2.1 are for EUSCI_A0_BASE
//So let me try these pins as the Interrupt vector above is for EUSCI_A0
//Looking at the launch pad see that it is using P3.4 and P3.5 so EUSCI_A1
// P2SEL1 |= (BIT0 + BIT1); /* P2.0,1 = USCI_A0 TXD/RXD
// (Setting UART pins on P2.0 and P2.1 ) */
// P2SEL0 &= ~(BIT0 + BIT1);
// UCA0CTLW0 |= UCSWRST; /* Put state machine in reset */
// UCA0CTL0 = 0x00;
//
// UCA0CTLW0 = UCSSEL__SMCLK + UCSWRST; /* Use SMCLK, keep RESET */
// /* 8MHz/115200 =0x45 (see User's Guide) */
// UCA0BRW = 0x341; /* 8MHz/9600= 833 =0x341 (see User's Guide) */
//
// UCA0MCTLW = 0;
//
// UCA0CTLW0 &= ~UCSWRST; /* Initialize USCI state machine */
//FR6989 Uart Pins P3.4 = Tx, P3.5 = RX
//TI help posting myUART_05-FR6989 show P3.4 P3.5 are for EUSCI_A1_BASE
P3SEL1 |= (BIT4 + BIT5); /* P2.0,1 = USCI_A0 TXD/RXD
(Setting UART pins on P2.0 and P2.1 ) */
P3SEL0 &= ~(BIT4 + BIT5);
UCA1CTLW0 |= UCSWRST; /* Put state machine in reset */
UCA1CTL0 = 0x00;
UCA1CTLW0 = UCSSEL__SMCLK + UCSWRST; /* Use SMCLK, keep RESET */
/* 8MHz/115200 =0x45 (see User's Guide) */
UCA1BRW = 0x341; /* 8MHz/9600= 833 =0x341 (see User's Guide) */
UCA1MCTLW = 0;
UCA1CTLW0 &= ~UCSWRST; /* Initialize USCI state machine */
/* Disable RX Interrupt on UART */
//FR5969 use UCA0 but FR6989 uses UCA1
// UCA0IFG &= ~ (UCRXIFG | UCRXIFG);
// UCA0IE &= ~UCRXIE;
UCA1IFG &= ~ (UCRXIFG | UCRXIFG);
UCA1IE &= ~UCRXIE;
#endif /* _USE_CLI_ */
}
Lorne