summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorja Martinez2016-09-12 08:46:52 -0500
committerBorja Martinez2016-09-12 08:46:52 -0500
commit3a38bd319fccc0addc4f911fbf2ad9a8d7a0d73e (patch)
treecae44044f5083ec52f2b6f43953ec4404d4b0b31
parent9e42b66aba50a9b7a59da43bfc4e4b81164b9528 (diff)
downloadi3-mote-3a38bd319fccc0addc4f911fbf2ad9a8d7a0d73e.tar.gz
i3-mote-3a38bd319fccc0addc4f911fbf2ad9a8d7a0d73e.tar.xz
i3-mote-3a38bd319fccc0addc4f911fbf2ad9a8d7a0d73e.zip
Updated MSP432 tests description
-rw-r--r--Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c24
-rw-r--r--[-rwxr-xr-x]Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c28
-rw-r--r--Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c14
-rw-r--r--Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c3
-rw-r--r--Basic-Test-Package/MSP432/Test_MSP432_DebugUART_EchoPC/main.c2
-rw-r--r--Basic-Test-Package/MSP432/Test_MSP432_I2C_M24xx256/main.c2
-rw-r--r--Basic-Test-Package/MSP432/readme.md88
7 files changed, 122 insertions, 39 deletions
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c
index cbd25b1..6240674 100644
--- a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c
+++ b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_M25P40/main.c
@@ -1,21 +1,23 @@
1/****************************************************************************** 1/******************************************************************************
2 * MSP432 SPI - 3-wire Master Interface to On board M24P40 2 * MSP432 SPI - 3-wire Master Interface to on-board M24P40
3 * 3 *
4 * Reads M25P40 Chip ID:
4 * 5 *
5 * ACLK = ~32.768kHz, MCLK = SMCLK = DCO 12MHz 6 * ACLK = ~32.768kHz, MCLK = SMCLK = DCO 12MHz
6 * 7 *
7 * Use with SPI Slave Data Echo code example.
8 * 8 *
9 * MSP432P401 9 * MSP432P401
10 * ----------------- 10 * -----------------
11 * | | 11 * | |
12 * | P1.4|-> FLASH_SPI_CSN (GPIO)
12 * | | 13 * | |
14 * | P1.5|-> FLASH_SPI_CLK (UCB0CLK)
13 * | | 15 * | |
14 * | P1.6|-> Data Out (UCB0SIMO) 16 * | P1.6|-> FLASH_SPI_MOSI_PIN (UCB0SIMO)
15 * | | 17 * | |
16 * | P1.7|<- Data In (UCB0SOMI) 18 * | P1.7|<- FLASH_SPI_MISO_PIN (UCB0SOMI)
17 * | | 19 * | |
18 * | P1.5|-> Serial Clock Out (UCB0CLK) 20 *
19 * Author: B.Martinez 21 * Author: B.Martinez
20*******************************************************************************/ 22*******************************************************************************/
21#include "i3mote.h" 23#include "i3mote.h"
@@ -27,9 +29,7 @@
27/* Standard Includes */ 29/* Standard Includes */
28#include <stdint.h> 30#include <stdint.h>
29#include <stdlib.h> 31#include <stdlib.h>
30
31#include <stdbool.h> 32#include <stdbool.h>
32
33#include <stdio.h> 33#include <stdio.h>
34 34
35/* Statics */ 35/* Statics */
@@ -44,7 +44,7 @@ const eUSCI_SPI_MasterConfig spiMasterConfig =
44{ 44{
45 EUSCI_A_SPI_CLOCKSOURCE_SMCLK, // SMCLK Clock Source 45 EUSCI_A_SPI_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
46 SYSFREQ, // SMCLK = DCO = 12MHZ 46 SYSFREQ, // SMCLK = DCO = 12MHZ
47 50000, // SPICLK = 50khz 47 100000, // SPICLK = 100kbps
48 EUSCI_A_SPI_MSB_FIRST, // MSB First 48 EUSCI_A_SPI_MSB_FIRST, // MSB First
49 EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, // Phase (Default) 49 EUSCI_A_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT, // Phase (Default)
50 EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, // High polarity 50 EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH, // High polarity
@@ -73,8 +73,8 @@ int main(void)
73 73
74 74
75 /* CS Configuring P3.0 as output */ 75 /* CS Configuring P3.0 as output */
76 MAP_GPIO_setAsOutputPin(FLASH_SPI_PORT, FLASH_SPI_NCS_PIN); 76 MAP_GPIO_setAsOutputPin(FLASH_SPI_PORT, FLASH_SPI_CSN_PIN);
77 MAP_GPIO_setOutputHighOnPin(FLASH_SPI_PORT, FLASH_SPI_NCS_PIN); 77 MAP_GPIO_setOutputHighOnPin(FLASH_SPI_PORT, FLASH_SPI_CSN_PIN);
78 78
79 /* SPI */ 79 /* SPI */
80 GPIO_setAsPeripheralModuleFunctionInputPin(FLASH_SPI_PORT, 80 GPIO_setAsPeripheralModuleFunctionInputPin(FLASH_SPI_PORT,
@@ -96,7 +96,7 @@ int main(void)
96 while (!(SPI_getInterruptStatus(EUSCI_A2_BASE,EUSCI_A_SPI_TRANSMIT_INTERRUPT))); 96 while (!(SPI_getInterruptStatus(EUSCI_A2_BASE,EUSCI_A_SPI_TRANSMIT_INTERRUPT)));
97 97
98 // CS 98 // CS
99 MAP_GPIO_setOutputLowOnPin(FLASH_SPI_PORT,FLASH_SPI_NCS_PIN); 99 MAP_GPIO_setOutputLowOnPin(FLASH_SPI_PORT,FLASH_SPI_CSN_PIN);
100 100
101 /* Transmitting first command to slave */ 101 /* Transmitting first command to slave */
102 TXData=0x9E; 102 TXData=0x9E;
@@ -166,7 +166,7 @@ void EUSCIA2_IRQHandler(void)
166 166
167 if(RXDataCnt==5){ 167 if(RXDataCnt==5){
168 168
169 MAP_GPIO_setOutputHighOnPin(FLASH_SPI_PORT, FLASH_SPI_NCS_PIN); 169 MAP_GPIO_setOutputHighOnPin(FLASH_SPI_PORT, FLASH_SPI_CSN_PIN);
170 170
171 /* Enable SysTick and Blink Forever */ 171 /* Enable SysTick and Blink Forever */
172 MAP_SysTick_enableModule(); 172 MAP_SysTick_enableModule();
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c
index 26ca9a2..a86aee1 100755..100644
--- a/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c
+++ b/Basic-Test-Package/MSP432/Test_MSP432_3wSPI_SlaveIRQ_CC2650_Master/main.c
@@ -1,18 +1,15 @@
1/****************************************************************************** 1/******************************************************************************
2 * MSP432 SPI - 3-wire Master Incremented Data 2 * MSP432 SPI - 3-wire Slave Echo
3 *
4 * This example shows how SPI slave echoes to SPI master using 3-wire mode.
3 * 5 *
4 * This example shows how SPI master talks to SPI slave using 3-wire mode.
5 * Incrementing data is sent by the master starting at 0x01. Received data is 6 * Incrementing data is sent by the master starting at 0x01. Received data is
6 * expected to be same as the previous transmission. eUSCI RX ISR is used to 7 * expected to be same as the previous transmission. eUSCI RX ISR is used to
7 * handle communication with the CPU, normally in LPM0. Because all execution 8 * handle communication with the CPU, normally in LPM0.
8 * after LPM0 is in ISRs, initialization waits for DCO to stabilize against
9 * ACLK.
10 * 9 *
11 * Note that in this example, EUSCIA1 is used for the SPI port. If the user 10 * Transactions are started by the slave (MSP432) through IRQ line.
12 * wants to use EUSCIA for SPI operation, they are able to with the same APIs
13 * with the EUSCI_AX parameters.
14 * 11 *
15 * ACLK = ~32.768kHz, MCLK = SMCLK = DCO 3MHz 12 * ACLK = ~32.768kHz, MCLK = SMCLK = DCO 12MHz
16 * 13 *
17 * MSP432P401 14 * MSP432P401
18 * ----------------- 15 * -----------------
@@ -64,8 +61,8 @@ const eUSCI_SPI_SlaveConfig spiSlaveConfig =
64 * http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html 61 * http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430BaudRateConverter/index.html
65 */ 62 */
66#ifdef UART_BAUD_9600 63#ifdef UART_BAUD_9600
67const eUSCI_UART_Config uartConfig = 64 const eUSCI_UART_Config uartConfig =
68{ 65 {
69 EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source 66 EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
70 78, // BRDIV = 78 67 78, // BRDIV = 78
71 2, // UCxBRF = 2 68 2, // UCxBRF = 2
@@ -75,12 +72,12 @@ const eUSCI_UART_Config uartConfig =
75 EUSCI_A_UART_ONE_STOP_BIT, // One stop bit 72 EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
76 EUSCI_A_UART_MODE, // UART mode 73 EUSCI_A_UART_MODE, // UART mode
77 EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling 74 EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling
78}; 75 };
79#endif 76#endif
80 77
81#ifdef UART_BAUD_115200 78#ifdef UART_BAUD_115200
82const eUSCI_UART_Config uartConfig = 79 const eUSCI_UART_Config uartConfig =
83{ 80 {
84 EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source 81 EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
85 6, // BRDIV = 78 82 6, // BRDIV = 78
86 8, // UCxBRF = 2 83 8, // UCxBRF = 2
@@ -90,7 +87,7 @@ const eUSCI_UART_Config uartConfig =
90 EUSCI_A_UART_ONE_STOP_BIT, // One stop bit 87 EUSCI_A_UART_ONE_STOP_BIT, // One stop bit
91 EUSCI_A_UART_MODE, // UART mode 88 EUSCI_A_UART_MODE, // UART mode
92 EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling 89 EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling
93}; 90 };
94#endif 91#endif
95 92
96 93
@@ -101,7 +98,6 @@ int main(void)
101 /* Halting WDT */ 98 /* Halting WDT */
102 WDT_A_holdTimer(); 99 WDT_A_holdTimer();
103 100
104 /* LEDS Configuring P8.x as output */
105 /* Set LED Pins as Output */ 101 /* Set LED Pins as Output */
106 MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR); 102 MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR);
107 MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG|LEDR); 103 MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG|LEDR);
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c b/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c
index 7011617..0ad179c 100644
--- a/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c
+++ b/Basic-Test-Package/MSP432/Test_MSP432_Blink_SysTick/main.c
@@ -1,9 +1,13 @@
1/******************************************************************************* 1/*******************************************************************************
2 * MSP432 Clock System - HFXT Startup 2 * MSP432 Blink
3 * 3 *
4 * Description: Starts the DCO to 48MHz sources MCLK from it, 4 * Description:
5 * Blinks two LEDs using SysTick (which is sourced from MCLK). 5 * Blinks two LEDs using SysTick (which is sourced from MCLK).
6 * 6 *
7 * Configuration:
8 * Starts the DCO to 12MHz and sources MCLK from it.
9 * BT1 pauses blinking.
10 *
7 * 11 *
8 * MSP432P401 12 * MSP432P401
9 * ------------------ 13 * ------------------
@@ -19,7 +23,6 @@
19 ******************************************************************************/ 23 ******************************************************************************/
20#include "i3mote.h" 24#include "i3mote.h"
21 25
22
23/* DriverLib Includes */ 26/* DriverLib Includes */
24#include "driverlib.h" 27#include "driverlib.h"
25 28
@@ -41,8 +44,8 @@ int main(void)
41 44
42 /* Set LED Initial Value */ 45 /* Set LED Initial Value */
43 MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDG); 46 MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDG);
44 //MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDR); 47 MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDR);
45 MAP_GPIO_setOutputHighOnPin(HID_PORT, LEDR); 48 //MAP_GPIO_setOutputHighOnPin(HID_PORT, LEDR);
46 49
47 /* Setting the external clock frequency (This API is optional) */ 50 /* Setting the external clock frequency (This API is optional) */
48 CS_setExternalClockSourceFrequency(32000,12000000); 51 CS_setExternalClockSourceFrequency(32000,12000000);
@@ -74,5 +77,4 @@ void SysTick_Handler(void)
74 if(MAP_GPIO_getInputPinValue(HID_PORT,BUTTON)){ 77 if(MAP_GPIO_getInputPinValue(HID_PORT,BUTTON)){
75 MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P6, GPIO_PIN2|GPIO_PIN3); 78 MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P6, GPIO_PIN2|GPIO_PIN3);
76 } 79 }
77
78} 80}
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c b/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c
index 3ba4325..e4df695 100644
--- a/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c
+++ b/Basic-Test-Package/MSP432/Test_MSP432_ClockSystem/main.c
@@ -15,7 +15,7 @@
15 * Starts the DCO 15 * Starts the DCO
16 * Sources SMCLK from DCO 16 * Sources SMCLK from DCO
17 * 17 *
18 * Blinks an LED using SysTick (which is sourced from MCLK). 18 * Blinks LEDs using SysTick (which is sourced from MCLK).
19 * 19 *
20 * 20 *
21 * 21 *
@@ -49,7 +49,6 @@
49 49
50/* Standard Includes */ 50/* Standard Includes */
51#include <stdint.h> 51#include <stdint.h>
52
53#include <stdbool.h> 52#include <stdbool.h>
54 53
55int main(void) 54int main(void)
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_DebugUART_EchoPC/main.c b/Basic-Test-Package/MSP432/Test_MSP432_DebugUART_EchoPC/main.c
index e296f08..8fc2001 100644
--- a/Basic-Test-Package/MSP432/Test_MSP432_DebugUART_EchoPC/main.c
+++ b/Basic-Test-Package/MSP432/Test_MSP432_DebugUART_EchoPC/main.c
@@ -86,7 +86,7 @@ int main(void)
86 MAP_GPIO_setAsPeripheralModuleFunctionInputPin(UART_PORT, 86 MAP_GPIO_setAsPeripheralModuleFunctionInputPin(UART_PORT,
87 UART_RX_PIN | UART_TX_PIN, GPIO_PRIMARY_MODULE_FUNCTION); 87 UART_RX_PIN | UART_TX_PIN, GPIO_PRIMARY_MODULE_FUNCTION);
88 88
89 /* LEDS Configuring P8.x as output */ 89 /* Set LEDS as output */
90 MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR); 90 MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR);
91 MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG|LEDR); 91 MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG|LEDR);
92 92
diff --git a/Basic-Test-Package/MSP432/Test_MSP432_I2C_M24xx256/main.c b/Basic-Test-Package/MSP432/Test_MSP432_I2C_M24xx256/main.c
index 2c7286c..6c38663 100644
--- a/Basic-Test-Package/MSP432/Test_MSP432_I2C_M24xx256/main.c
+++ b/Basic-Test-Package/MSP432/Test_MSP432_I2C_M24xx256/main.c
@@ -45,7 +45,7 @@ void main(void)
45 45
46 /* LEDs */ 46 /* LEDs */
47 MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR); 47 MAP_GPIO_setAsOutputPin(HID_PORT,LEDG|LEDR);
48 MAP_GPIO_setOutputLowOnPin(HID_PORT, LEDG|LEDR); 48 MAP_GPIO_setOutputLowOnPin(HID_PORT,LEDG|LEDR);
49 49
50 /* Initialize I2C communication */ 50 /* Initialize I2C communication */
51 Init_I2C_GPIO(); 51 Init_I2C_GPIO();
diff --git a/Basic-Test-Package/MSP432/readme.md b/Basic-Test-Package/MSP432/readme.md
index 2d3a212..821bc54 100644
--- a/Basic-Test-Package/MSP432/readme.md
+++ b/Basic-Test-Package/MSP432/readme.md
@@ -1 +1,87 @@
1## Contents 1Basic Test Package for I3MOTE-MSP432
2====================================
3
4Test MSP432-Blink-SysTick
5-------------------------
6Blinks two LEDs using SysTick (which is sourced from MCLK). BT1 pauses blinking.
7
8#### Configuration:
9* DCO @ 12MH
10* MCLK sourced from DCO.
11
12***
13
14Test MSP432-ClockSystem
15-------------------------
16Configures MCLK, HSMCLK and ACLK outputs for crystal testing.
17
18#### Configuration:
19* P4.2 -> ACLK: 32.768 KHz (Source 32.768Khz crytal @ LFXTL)
20* P4.3 -> MCLK: 12.000 MHz (Source 48Mhz crytal @ HFXTL)
21* P4.4 -> HSMCLK: 6.000 MHz
22* P7.0 -> SMCLK: 6.000 Mhz
23
24***
25
26Test MSP432-DebugUART-EchoPC
27----------------------------
28Echoes back characters received via a PC serial port.
29
30#### Configuration:
31* DCO @ 12MHz -> SMCLK
32* SMCLK sourced from DCO.
33* Uart 115200.
34
35***
36
37Test MSP432-I2C-M24xx256
38------------------------
39Writes and checks on-board I2C EEPROM.
40
41#### Configuration:
42* DCO @ 12MH
43* SMCLK sourced from DCO.
44* I2C 100kbps.
45
46***
47
48Test MSP432-I2C-Sensors
49-----------------------
50Reads General Purpose Sensors IDs.
51
52#### Configuration:
53* DCO @ 12MH
54* SMCLK sourced from DCO.
55* I2C 100kbps.
56
57***
58
59Test MSP432-3wSPI-M25P40
60------------------------
61Reads on-board SPI flash memory ID (M25P40).
62
63#### Configuration:
64* DCO @ 12MH
65* SMCLK sourced from DCO.
66* SPI 100kbps.
67
68***
69
70Test MSP432-3wSPI-SlaveIRQ-CC2650-Master
71----------------------------------------
72SPI slave echoes to SPI master using 3-wire mode.
73Incrementing data is sent by the master starting at 0x01.
74Received data is expected to be same as the previous transmission.
75Transactions are started from the slave (MSP432) using the IRQ line.
76
77#### Configuration:
78* DCO @ 12MH
79* SMCLK sourced from DCO.
80* Requires Test CC2650-3wSPI-Master-MSP432-SlaveIRQ running on CC2650
81
82***
83
84Tested using *MSPWare_3_30_00_18* and *TI-v15.12.1-LTS* Compiler
85
86
87