Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all 22391 articles
Browse latest View live

MSP432P401R: alignment errors from driverlib

$
0
0

Part Number:MSP432P401R

 

The following throws an unaligned trap when used with Port 2 (and others).  The reason is HWREG16 forces a ldrh instruction to be used which will fail if one has unaligned traps turned on.  Also accessing an unaligned with ldrh can cause extra bus cycles on the memory bus (depends on the memory system design).

I know someone is going to say, turn unaligned traps off.  Yes that would solve this particular problem.  So let's talk about why one would want unaligned traps on.

 

The msp432 is a risc machine with a finely turned memory system that is optimized for a load/store architecture.  In general one strives for aligned accesses because there is a performance penalty when unaligned.  So one turns on the unaligned trap to identify mistakes.

The driverlib as currently written causes alignement traps.  So if one is using the lib then one can't turn on alignement traps.

 

yes, i realize it is probably too late to do anyting about this, since driverlib is burned into ROM.  But I felt I should bring this to your attention anyway so that the mistake isn't repeated.  This is a result first how the registers are laid out.  The next error is how the registers are being accessed, in particular forcing all register accesses to be 16 bits even with unaligned by use of the HWREG16 macro.

You can work around the architectural problem (the register definitions) by using the structure definitions.  But to use those you have to figure out if the register is odd or even (the type) and then accessing it via that pointer.  This will take care of generating the correct instruction to avoid the unaligned trap and any performance penalty.  The weird even odd type stuff is a direct result of how weirdly the ports are layed out.  (Yes, I understand the original motivation, and it did seem like the thing to do at the time, but it really is a mistake).

 

void GPIO_setAsInputPinWithPullDownResistor(uint_fast8_t selectedPort,
uint_fast16_t selectedPins)
{

uint32_t baseAddress = GPIO_PORT_TO_BASE[selectedPort];

HWREG16(baseAddress + OFS_LIB_PASEL0) &= ~selectedPins;
HWREG16(baseAddress + OFS_LIB_PASEL1) &= ~selectedPins;

HWREG16(baseAddress + OFS_LIB_PADIR) &= ~selectedPins;
HWREG16(baseAddress + OFS_LIB_PAREN) |= selectedPins;
HWREG16(baseAddress + OFS_LIB_PAOUT) &= ~selectedPins;
}


MSP430F169: I2C Master Slave

$
0
0

Part Number:MSP430F169

Hello ....,

I have used an example  fet140_i2c_06.s43 MSP430F169 Master and  fet140_i2c_07.s43 MSP430F169 Slave to test I2C Transfer.

At my Oszilloscope I can see, the Master send the Slave-Adress but the Slave set not the acknoweledge Bit. What is the Reason for this?

Wy does not react the Slave?

I am grateful for help.

regards Jurgen Rieger

MSP430F6765A: How to utilize PIN.h for MSP430, Board.h?

$
0
0

Part Number:MSP430F6765A

I'm new to CCS but I'm learning quickly. I've got a great start on a RTOS project and have created proof of concepts for all my peripherals. Before I start the job of integrating all the tasks, I'm reviewing the code and am exploring PIN.h as an alternative to the driver lib implementations I've been using.

Here's an example of what I have so far:

// Configure LEDs
GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN1 | GPIO_PIN2);
GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6);
GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN4 | GPIO_PIN5 | GPIO_PIN6);
GPIO_setDriveStrength(GPIO_PORT_P2, GPIO_PIN4, GPIO_FULL_OUTPUT_DRIVE_STRENGTH); // Drive blue at full strength

// Buttons - Common is P1.4, Interrupt 45
GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN4);
GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN4);
unsigned char allButtonsMask = GPIO_PIN0 | GPIO_PIN1 | GPIO_PIN2 | GPIO_PIN3;
GPIO_setAsInputPinWithPullDownResistor( GPIO_PORT_P1, allButtonsMask);
GPIO_enableInterrupt( GPIO_PORT_P1, allButtonsMask);
GPIO_selectInterruptEdge(GPIO_PORT_P1, allButtonsMask, GPIO_LOW_TO_HIGH_TRANSITION);

I've read through the whole PIN.h. It seems like great documentation, but I can't figure out how to get the integers for the PIN_IDs. I imagine they are coming from a Board.h implementation, but I don't know where to find those, either.

#define HUI_LED_A     PIN_ID(11) // Where do I find "11" for my board's GPIO_PORT_P2, GPIO_PIN1?

I did a lot of work to build my own driverlib for this board via . However, I think I've skipped .

I've been flying without a Board.h for a while... Is there an easier way to get one of these or do I need to port it manually? I want to avoid recreating the wheel.

MSP432P401R: different values on ADC0 and ADC1

$
0
0

Part Number:MSP432P401R

I'm running the example ADC Project from the TI-RTOS Driver examples, and with the same dc signal applied to ADC0 (P5.5) and ADC1(P5.4) I get different values (ADC1 approx 35x lower result than ADC0)

A few examples:

Starting the ADC Single Channel example
System provider is set to SysMin.  Halt the target to view any SysMin contents in ROV.
ADC channel 0 initialized
ADC channel 0 convert result: 0x0
ADC channel 1 initialized
ADC channel 1 convert result (0): 0x0

Starting the ADC Single Channel example
System provider is set to SysMin.  Halt the target to view any SysMin contents in ROV.
ADC channel 0 initialized
ADC channel 0 convert result: 0x404
ADC channel 1 initialized
ADC channel 1 convert result (0): 0x15

Starting the ADC Single Channel example
System provider is set to SysMin.  Halt the target to view any SysMin contents in ROV.
ADC channel 0 initialized
ADC channel 0 convert result: 0xb89
ADC channel 1 initialized
ADC channel 1 convert result (0): 0x39

Is there something I'm missing?

MSP-CAPT-FR2633: CAPTIVATE-ISO Rev B/C - Silkscreen error

$
0
0

Part Number:MSP-CAPT-FR2633

FYI

the"CAPTIVATE-ISO Rev C" PCB  from the  MSP-CAPT-FR2633 Dev Kit has an Silkscreen error on the Target side.

RST/TST signals markings are flipped.

also found the error in the CAPTIVATE-ISO_REV_B_PCB_layers.PDF from the hardware sources.

caused us some disorientation here :)

best regards Peter



About MSP as ISP

$
0
0

Can MSP430FG4250IRGZR be programmed with MSP430F5529 USB LaunchPad.If possible please tell how to do it.

Im just a beginner.

MSP430FR2633: MSP430FR2633(Capacitive touch Development board) UART0 configuration issue

$
0
0

Part Number:MSP430FR2633

Hello Everyone,

I am working on MSP430FR2633 Capacitive touch development board.

Using the capacitive touch  user guide i have worked on example codes and all the peripherals(buttons,wheel,slider) are working fine.

Right now the interface between the main MCU(MSP430FR2633) and GUI is happneing using BULKI2C using the HID bridge controller.

There is also a option to interface using UART, which right now is unused.

ISSUE:

Now i need to use that UART for one of my other application externally ,but as i am trying to configure the UART its not working.

The main clock is ACLK (32768) which i am using as clock to UART0. i have set the clock as device specific

Board has a external crystal oscillator (32768) which is been used.

UCA0CTL1 |=UCSSEL_1;    which is device specific.

Pins (Tx and Rx) are port 1 pins 1.4 and 1.5.

What might be the issue? can i use the UART0 as it is also used for Bridge interface but unused?

there is a jumper  in the board (which i have removed )which bypasses the UART communication between the bridge so that it can be used for some other application.

this is my code for UART0 configuration.

P1SEL0 = (BIT4 + BIT5);

P1SEL1 = (BIT4 + BIT5);

UCA0CTL1 |= UCSWRST;
UCA0CTL1 |= UCSSEL_1; // Set ACLK = 32768 as UCBRCLK
UCA0CTL1 = UCMODE_0;
UCA0BR0 = 0x03; // 9600 baud
UCA0BR1 =0x00;

UCA0MCTLW |= 0x53;  

UCA0CTL1 &= ~UCSWRST; // release from reset
UCA0IE |= UCRXIE; // enable RX interrupt

Regards,

Sanath Rai

MSP432P401R: How to use MSP-GANG programmer to download application for MSP432 in BSL mode?

$
0
0

Part Number:MSP432P401R

I've configured the flash mailbox and use P1.1 as the BSL entry sequence. Then, which pin in the 14-pin JTAG should I use to connect with P1.1 in my target board? The TCK pin?  If I want to download my application into MSP432P401R with BSL interface, I choose "BSL" in the "Interface Option" group in the MSP-GANG Programmer Software, then how should I deal with the "BSL 1-st Passw" group? What do these three options (Code File, Passw.File, All 0xFF) mean? I cannot find any description about this in the MSP GANG Programmer User's Guide.


CCS/MSP430F5529: Code help for Bandpass Filtering

$
0
0

Part Number:MSP430F5529

Tool/software: Code Composer Studio

Hi there, 

I have been working on implementing a Bandpass Filter on msp430F5529 using Code composer studio.

If someone has already worked on such task, can u just post ur code here so that i'll just have a better experience with implementation.

Thank you.

TIDM-MSP-DALI: What is EVM used to implement TIDM-MSP-DALI design?

MSP-EXP430G2: MSP-EXP430G2 can't work I2C

$
0
0

Part Number:MSP-EXP430G2

Hello,

I am working with MSP-EXP430G2 evm and my controller is MSP430G2553.i interfaced PCA8565 RTC using i2c protocol.for your reference below i given is my code for this rtc.please try to solve my below query:

1) when i run this code in oscilloscope i am not getting CLK waveform instead i am getting DC voltage at SCL pin.

2) when i run this code then code stuck in function rtc_write_reg(in my code i have highlighted with red colour the line where my code getting stuck).

//=======================================================================================

#include <msp430.h>
#include <stdint.h>

#define RTC_ADDRESS          0xA2

#define I2C_READ 1
#define I2C_WRITE 0

//----------RTC PCA8565 Macros-------------------

#define CONTROL_1 0x00
#define CONTROL_2 0x01
#define SECONDS 0x02
#define MINUTES 0x03
#define HOURS 0x04
#define DAYS 0x05
#define WEEKDAYS 0x06
#define MONTHS_CENTURY 0x07
#define YEARS 0x08
#define CLKUT_CONTROL 0x0D
#define TIMER_CONTROL 0x0E
#define TIMER 0x0F

void i2c_start(void)
{
UCB0CTL1 = UCTR + UCTXSTT; // I2C TX, start condition
while(UCB0CTL1 & UCTXSTT); // Ensure start condition got sent
}

void i2c_write_byte(uint8_t data)
{
UCB0TXBUF = data; // Load TX buffer
while(UCB0CTL1 & UCTXSTT); // wait for Ack from slave
}

void i2c_stop(void)
{
UCB0CTL1 |= UCTXSTP; // I2C stop condition after 1st TX
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent
}

void i2c_repeated_start(void)
{
UCB0CTL1 = ~UCTR + UCTXSTT; // I2C RX, start condition
while(UCB0CTL1 & UCTXSTT); // Ensure repeated start condition got sent
}

uint8_t i2c_read_byte(void)
{
uint8_t data = 0;
data = UCB0RXBUF;

return data;
}

void i2c_give_nack(void)
{
UCB0CTL1 |= UCTXNACK;
while(UCB0CTL1 & UCTXNACK);
}

void rtc_write_reg(uint8_t addr, uint8_t data)
{
UCB0I2CSA = RTC_ADDRESS; // Slave Address is 048h
i2c_start(); //send start condition and slave address

i2c_write_byte(addr);
i2c_write_byte(data);
i2c_stop();

}

uint8_t rtc_read_reg(uint8_t addr)
{
uint8_t result;

UCB0I2CSA = RTC_ADDRESS; // Slave Address
i2c_start();
i2c_write_byte(addr);

UCB0I2CSA = RTC_ADDRESS | I2C_READ; // Slave Address with read option
i2c_repeated_start();

result = i2c_read_byte();

i2c_give_nack();
i2c_stop();

return result;

}


int main(void)
{
uint8_t data = 0;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P1SEL |= BIT6 + BIT7; // Assign I2C pins to USCI_B0
P1SEL2|= BIT6 + BIT7; // Assign I2C pins to USCI_B0
UCB0CTL1 |= UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = 12; // fSCL = SMCLK/12 = ~100kHz
UCB0BR1 = 0;
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation

while (1)
{
rtc_write_reg(SECONDS,10);
__delay_cycles(90000);
data = rtc_read_reg(SECONDS);
__delay_cycles(90000);

}
}

//===========================================================================================

Please try to solve my above two query.any help in this will be appreciated more.

Thank You

 Bhavin

MSP430F5340: Regarding MSP430 failure on EFT/Burst

$
0
0

Part Number:MSP430F5340

I am using MSP430F5340 in my design and the only I/Os used are that of ADCs and UART and the rest of the I/O lines are grounded. I tested the design on EFT/Burst and observed that if I used the internal DCO at 8Mhz as my clock (no external crystal used, crystal pins grounded) the MSP doesn’t malfunction even with 4KV pulse. If I used an external crystal of 16MHz with series resistances of 22ohm and capacitors of 33pF(crystal ABM3-16.000MHZ-D2Y-T), the MSP hangs completely 0.5KV pulse. I am confused as to why external crustal result into such a failure in EFT testing? What points I need to check in lsyout or otherwise.

  1. During test I unknowingly didn't change the XT2DRIVE bits from 0 to 1 while changing from a 8MHz crystal to 16Mhz crystal. Will that make any difference while doing EFT tests?

  2. When I referred MSP430FR5994 launchpad schematic it didn't show external capacitors. Should I use those? If I opted not to use those then is there any way to enable internal capacitors of the MSP. And if yes, of what values should I choose? And the launchpad design didn't show any series resistances also. Should I use those as well or not?

  3. And If I decided to use internal crystal /DCO at 8Mhz, will it be stable in the temperature range of -20 to +70 Degrees or at-least between 0 to 70 Degrees.   

CCS/MSP430F5659: How to clear free running Timer B in between

$
0
0

Part Number:MSP430F5659

Tool/software: Code Composer Studio

Hi,

I am working on MSP430F5659 controller, using 2 timers.

1. Timer A0 for capture the pulse high to low

2. Free running timer B - updating counter on overflow

Timer Init routine has : TBCTL = TBSSEL_2 | MC_1 | TBCLR | TBIE; // SMCLK, contmode, clear TBR // enable interrupt

I want to reset the counter values ( timer B counter value) in between to 0. I don't want to overflow the timer B and overflow interrupt as well.

Please guide me how to do this ?

Nitesh

CCS/MSP432P401R: MSP432 spi communication, clk doesn't work when receiving data

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

Hi,

I'm using custom board with MCU as MSP432P401R.

I'm trying to communicate msp432 as a master and enc424j600(ethernet) as a slave with spi connection.

I found out that when spi receiver(MISO) interrupt occurs clk(P1.5) doesn't give any signal.

However when transmitting data(MOSI) I can see clk signal with oscilloscope.

Is there any solution or suggestion why spi reciever or clk don't work? 

Here comes the code!!

/*
 *
 * MSP432 = SPI master, external device = SPI slave
 *
 *                MSP432P401R
 *              -----------------
 *             |                 |
 *             |            P1.4 |-> CS
 *             |                 |
 *             |            P1.6 |-> Data Out (UCB0SIMO)
 *             |                 |
 *             |            P1.7 |<- Data In (UCB0SOMI)
 *             |                 |
 *             |            P1.5 |-> Serial Clock Out (UCB0CLK)
 *******************************************************************************/

const eUSCI_SPI_MasterConfig spiMasterConfig =
{
        EUSCI_B_SPI_CLOCKSOURCE_SMCLK,                  // SMCLK Clock Source
        24000000,                                        
        500000,                                         
        EUSCI_B_SPI_MSB_FIRST,                          
        EUSCI_B_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT,
        EUSCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH,      
        EUSCI_B_SPI_3PIN                                
};

int main(void)
{
   int                           Result;
   uint16_t       Result1;
   BTPS_Initialization_t         BTPS_Initialization;
   HCI_DriverInformation_t       HCI_DriverInformation;
   HCI_HCILLConfiguration_t      HCILLConfig;
   HCI_Driver_Reconfigure_Data_t DriverReconfigureData;


   /* Configure the hardware for its intended use.                      */
   HAL_ConfigureHardware();


   /* Flag that sleep is not currently enabled.                         */
   SleepAllowed = FALSE;


   /* Configure the UART Parameters.                                    */
   HCI_DRIVER_SET_COMM_INFORMATION(&HCI_DriverInformation, 1, HAL_HCI_UART_MAX_BAUD_RATE, cpHCILL_RTS_CTS);
   HCI_DriverInformation.DriverInformation.COMMDriverInformation.InitializationDelay = 100;

   /* Set up the application callbacks.                                 */
   BTPS_Initialization.GetTickCountCallback  = HAL_GetTickCount;
   BTPS_Initialization.MessageOutputCallback = HAL_ConsoleWrite;

   /* Initialize the application.                                       */
   if((Result = InitializeApplication(&HCI_DriverInformation, &BTPS_Initialization)) > 0)
   {

      /* Save the Bluetooth Stack ID.                                   */
      BluetoothStackID = (unsigned int)Result;

 
      BTPS_Delay(200);
     

 GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN4);
 GPIO_setAsPeripheralModuleFunctionInputPin (GPIO_PORT_P1, GPIO_PIN7 | GPIO_PIN6 | GPIO_PIN5 , GPIO_PRIMARY_MODULE_FUNCTION);

    GPIO_setAsOutputPin(GPIO_PORT_P1,GPIO_PIN4);
    GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN4);

 MAP_SPI_initMaster(EUSCI_B0_BASE, &spiMasterConfig);

 MAP_SPI_enableModule(EUSCI_B0_BASE);


 MAP_SPI_enableInterrupt(EUSCI_B0_BASE, EUSCI_B_SPI_RECEIVE_INTERRUPT);
 Interrupt_enableInterrupt(INT_EUSCIB0);

 MAP_Interrupt_disableInterrupt(INT_EUSCIB0);


      MAP_Interrupt_disableInterrupt(INT_EUSCIB0);
      BTPS_Delay(100);
      GPIO_setOutputLowOnPin(GPIO_PORT_P1,GPIO_PIN4);

      //while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
      MAP_SPI_transmitData(EUSCI_B0_BASE, 0x22);
      //while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
      MAP_SPI_transmitData(EUSCI_B0_BASE, 0x16);
      //while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
      MAP_SPI_transmitData(EUSCI_B0_BASE, 0x33);
      //while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
      MAP_SPI_transmitData(EUSCI_B0_BASE, 0x31);
      GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN4);
      BTPS_Delay(1);
      GPIO_setOutputLowOnPin(GPIO_PORT_P1,GPIO_PIN4);
      //while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
      MAP_SPI_transmitData(EUSCI_B0_BASE, 0x20);
      //while (!(SPI_getInterruptStatus(EUSCI_B0_BASE,EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
      MAP_SPI_transmitData(EUSCI_B0_BASE, 0x16);

      BTPS_Delay(1);
      while (MAP_GPIO_getInputPinValue(GPIO_PORT_P1, GPIO_PIN7));
      Interrupt_enableInterrupt(INT_EUSCIB0);

      GPIO_setOutputHighOnPin(GPIO_PORT_P1,GPIO_PIN4);
      Display(("%d \r\n",a));

            /* We need to execute Add a function to process the command line  */
      /* to the BTPS Scheduler.                                         */
      if(BTPS_AddFunctionToScheduler(ProcessCharactersTask, NULL, 100))
      {
         /* Add the idle task (which determines if LPM3 may be entered) */
         /* to the scheduler.                                           */
         if(BTPS_AddFunctionToScheduler(IdleTask, NULL, 100))
         {
            if(BTPS_AddFunctionToScheduler(ToggleLEDTask, NULL, 750))
            {
               HAL_SetLEDColor(hlcGreen);

               /* Execute the scheduler, note that this function does   */
               /* not return.                                           */
               BTPS_ExecuteScheduler();
            }
         }
      }
   }

   /* If we've gotten to this point then an error has occurred, set the */
   /* LED to red to signify that there is a problem.                    */
   HAL_SetLEDColor(hlcRed);

   /* Poll the error flags to see if we can determine the reason for the*/
   /* failure.                                                          */
   PollErrorFlags();

   /* Scheduler above should run continuously, if it exits an error     */
   /* occurred.                                                         */

   while(1)
   {
      HAL_ToggleLED();

      BTPS_Delay(100);
   }

}

void EUSCIB0_IRQHandler(void)
{
    //GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN4);
    uint32_t status = SPI_getEnabledInterruptStatus(EUSCI_B0_BASE);
    SPI_clearInterruptFlag(EUSCI_B0_BASE, status);
    if(status & EUSCI_B_SPI_RECEIVE_INTERRUPT)
    {
        /* USCI_B0 TX buffer ready? */
        while (!(SPI_getInterruptStatus(EUSCI_B0_BASE, EUSCI_B_SPI_TRANSMIT_INTERRUPT)));
        RXData = MAP_SPI_receiveData(EUSCI_B0_BASE);
        Display(("RXData = %x\r\n",RXData));
        //BTPS_Delay(10);
        //GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN4);

    }
}

MSP430FR2633: Captivate Design Center Code Generation

$
0
0

Part Number:MSP430FR2633

Hi, 

I am working on a design based on MSP430FR2633 and am trying to use the Captivate Design Center.

I used to gui to setup the sensors. - buttons and proximity sensors, save the project and hit Generate Source Code to generate the code.

I imported the code into CCS and built it - no problem so far - except the project was setup for 2532 even though i had selected 2633 as the controller in the GUI.

Since it wasn't detecting any buttons or proximity, digging into the code - it looks like the design center just created a structure with a template without actually generating any code at all. For example CAPT_SENSOR_COUNT in CAPT_UserConfig.h is set to 0, g_pCaptivateSensorArray is empty etc. 

Did i just get taken in by the marketing koolaid or do i need to set some other button in the GUI to actually generate code? I was expecting all the control structures to be properly filled in - none of them seem to be.


Linux: New MSP430FR4133 firmware update failure, now cannot connect

$
0
0

Tool/software: Linux

I am new to the MSP platform, I have obtained a MSP430FR4133 dev board. Using ubuntu Linux I tried to upload to it using MSPdebug, I got a message saying the firmware needed updating, so I ran MSPdebug firmware update. The update seemed to be going ok until it got to 100% then it failed. 

$ mspdebug tilib --allow-fw-update

MSPDebug version 0.22 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2013 Daniel Beer <dlbeer@gmail.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MSP430_GetNumberOfUsbIfs
MSP430_GetNameOfUsbIf
Found FET: ttyACM0
MSP430_Initialize: ttyACM0
FET firmware update is required.
Starting firmware update (this may take some time)...
Initializing bootloader...
Programming new firmware...
75 percent done
84 percent done
84 percent done
91 percent done
100 percent done
tilib: MSP430_FET_FwUpdate: MSP-FET / eZ-FET core(communication layer) update failed (error = 74)
tilib: device initialization failed

After the update failure I have been unable to connect to the board. Previously it showed up as a /dev/ttyAMA device. Linux still recognises it as a USB device but it does not mount as a ttyAMA0:

[ 4546.769995] usb 1-2: new full-speed USB device number 17 using xhci_hcd
[ 4546.934999] usb 1-2: New USB device found, idVendor=2047, idProduct=0203
[ 4546.935028] usb 1-2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 4546.937253] hid-generic 0003:2047:0203.0004: hiddev0,hidraw0: USB HID v1.01 Device [HID 2047:0203] on usb-0000:00:14.0-2/input0

Is there anything i can do to fix this or is the board bricked? 

CCS/MSP432P401R: MSP-FET for MSP432P401R, A customer has asked about two troubles

$
0
0

Part Number:MSP432P401R

Tool/software: Code Composer Studio

Hello,

 

Our customer has complained about two troubles of MSP-FET and MSP432P401R as bellow.

1) Step-debug execution can’t work by interrupted from peripherals.

2) PCM check code as the following jumps to error (), but it works well after HW reset.

if (PCM->IFG & PCM_IFG_AM_INVALID_TR_IFG)   error();

3) With using XDS110-ET, these problems don’t be caused.

 

I’ve reproduced these troubles.

My tools: MSP-TS432PZ100, MSP-FET(firmware updated)and CCSv6.2.0.00050(updated).

Used examples are _ta0_01.c for 1) and _pcm_04.c for 2).

 

I asked the customer to use XDS110-ET, but he has strongly requested the update schedule of these troubles.

Please email me about update schedules.

 

Best Regards,
Kazuo Yamauchi

Compiler/MSP430F5131: 1 PULSE PER SECOND CODE CHECKING

$
0
0

(Please visit the site to view this file)Part Number:MSP430F5131

Tool/software: TI C/C++ Compiler

Hello ,
I'm new to this field of microcontroller and i need you quick help with a new project of mine.
 
I'm using MSP430F5131.
I will explain a little about the project :
My main goal is to generate a 1 pulse per second  using a 12.8MHz external oscillator.
I already have a printed PCB for that project which means i got to understand what the previous designer had done and implement it into my CCS program in order to program my micro controller.
i am still new to this whole microcontroller world and im eager to know more , although im short in time.
 
I have attached an electrical wiring of the PCB to help you understand a little bit more about the project.
 
A little explanation of the electrical wiring:
An external toggle switch (from connector J6 "Internal/External Selection") switch between an external 1pps (From an external GPS) or internal 1pps (by the msp430).
if we choose an internal mode then (input P2.2) a '1' (or '0' if its an active low mode which is an active low mode) sends from PJ.3 (ouput) to U4 and a 1 pulse per second gets out of P2.4 output to connectors J8 and J9 (same pulse different connectors).
 
I can Switch signals to ON/BAD/OFF by using an external toggle switch(pins 1,2 of J3 connector) or a descrete (pin 3 of J3 connector).
if i toggle the switch to on mode it sends '1'(or '0' if its an active low mode which is an active low mode) through P1.6 to U5 ( And Gate) and enables the pulse it also sends '1' through PJ.0 to U6 and converts the pulse from TTL to RS422 (differetial).
The descrete switching option switches the pulse (ON/OFF) the same as the external toggle switch.
This is refers to PULSE 1 , i need to implement the same thing for PULSE 2.
 
although im still not sure what RST/NMI/SBWTDIO and TEST/SBWTCK are wired for , are these for downloading the program into the msp?
im also not sure about the PJ.2 pin (FUNCTIONALITY DISABLE).
#include "msp430.h"
#include "intrinsics.h"

// defining flags as volatile(coz we use these variables in the main and in the ISR as well):
volatile unsigned int timerCount = 0; 	//defines the millisecond counter
volatile unsigned int normalPulse1=0; 	//defines another flag to indicates when 1 second has passed for normal pulse1
volatile unsigned int badPulse1=0;		//defines another flag to indicates when 1 second has passed for bad pulse1
volatile unsigned int normalPulse2=0; 	//defines another flag to indicates when 1 second has passed for normal pulse2
volatile unsigned int badPulse2=0;		//defines another flag to indicates when 1 second has passed for bad pulse2
volatile unsigned int secondsCount=0;	//defines the seconds count for the bad pulse


void main() { //Main function

	// configure watchdog timer:
	WDTCTL = WDTPW | WDTHOLD;					// Stop watchdog timer
	P2OUT &= ~(BIT4); 							//preload 1pps to '0'


	// set I/O pins directions:
	P1DIR |=BIT6+BIT7;                      //set p1.x to 11000000
	P2DIR |=BIT4;	                       // Set P2.4 to output direction
    PJDIR |=BIT0+BIT1+BIT3;                // set pj.x output 0000 1011
    P2SEL |= BIT4;						   //select the option of using TD0.0 in pin 2.4
    //P2IES |= BIT4;                         // high -> low is selected with IES.x = 1.
    //P2IFG &= ~(BIT4);                      // To prevent an immediate interrupt, clear the flag for
                                          // P2.4 before enabling the interrupt.
    //P2IE |= BIT4;                          // Enable interrupts for P2.4

    // Configure XT1 (external oscillator):
    PJSEL |= BIT4+BIT5;						// port select for xt1
    UCSCTL6 &= ~(XT1OFF); 				    //xt1 is on
    UCSCTL3 = 0;                            // FLL REFERENCE CLOCK REFERENCE = XT1

    // configure TD0.0 (TimerD0.0):
    TD0CTL0 |=MC_1+ID_3+TDSSEL_0+TDIE+CNTL_0+TDCLR;                //defining timer d TD0.0 (P2.4) upmode , devide by 8 , TDCLK , enable interupt , 
    TD0CCR0=1600-1;                          // setting TAR count up value 1600 (12.8MHz / 8 = 1.6MHz , 1.6MHz / 1600 = 1000 Hz) when 1000 is passed means 1 second has passed as well
	//TD0CCR1 =400-1;                           // setting the duty cycle to 25% pulse
    TD0CCTL0 |= CCIE;                        //ENABLES CCIFG INTERUPT ON CCR0
	//TD0CCTL1 |=CCIE;							//ENABLES CCIFG INTERUPT ON CCR1


    __enable_interrupt();    					//enables interupts in the ISR


    for(;;){                      // Main loop - Endless loop



    	//   EXTERNAL / INTERNAL SELECTION BY SW4

    	if ((P2IN & BIT2)==0){         //  INTERNAL MODE
		
    		PJOUT |=BIT3;              // sends '1' from pj.3 output to the multiplexer U4 (uses the internal 1pps)

    		//PULSE 1 : DESCRETE ON/OFF AND SWITCH ON/BAD/OFF

                     if ((P2IN & BIT0)==0 || (P1IN & BIT0)==0) {        //NORMAL SIGNAL OF 1PPS checks if descrete source is on or 1pps sw pulse 1 is on
                    	 P1OUT |= BIT6; 									//ENABLES PULSE BY THE 'AND' GATE
                    	 PJOUT |= BIT0;									//ENABLES TTL TO RS232 CONVERTER (FOR DIFF OUTPUT)
                          if(normalPulse1==1){                       //checks if normalPulse1 is on from the ISR
						    normalPulse1 =0;                           // sets normalPulse1 to 0 again so the ISR will generate the pulse 
						    P2OUT ^=BIT4;                            //generates 1pps out of p2.4
						 }

                	 }
                   
                     else {
                    	 P1OUT |= ~(BIT6); 								//DISABLES PULSE BY SENDING A '0' TO THE AND GATE
                     }

                     if ((P1IN & BIT2)==0)  {							//PULSE 1 BAD SIGNAL checks if the 1pps sw bad pulse is on
                    	  P1OUT |= BIT6; 									//ENABLES PULSE BY THE 'AND' GATE
                    	  PJOUT |= BIT0;									//ENABLES TTL TO RS232 CONVERTER (FOR DIFF OUTPUT)
						    if(badPulse1==1){                             //checks if badPulse1 is on from the ISR
							  badPulse1=0;                                // sets badPulse1 to 0 again so the ISR will generate the pulse
							  P2OUT ^=BIT4;                            //generates 1pps out of p2.4
							
							}
                     }

                     //PULSE 2 : DESCRETE ON/OFF AND SWITCH ON/BAD/OFF


                     if ((P2IN & BIT1)==0 || (P1IN & BIT0)==0){			//NORMAL SIGNAL OF 1PPS checks if descrete source is on or 1pps sw pulse 2 is on
                    	 P1OUT |= BIT7; 									//ENABLES PULSE BY THE 'AND' GATE
                    	 PJOUT |= BIT1;	 								//ENABLES TTL TO RS232 CONVERTER (FOR DIFF OUTPUT)
							if(normalPulse2==1){
								normalPulse2=0;								// sets normalPulse2 to 0 again so the ISR will generate the pulse
								P2OUT ^=BIT4;                            //generates 1pps out of p2.4
							
							}


                     }


    	
                     else {
                    	 P1OUT |= ~(BIT7);									//DISABLES PULSE BY SENDING A '0' TO THE AND GATE
                     }

                     if ((P1IN & BIT3)==0){								//PULSE 2 BAD SIGNAL 
                    	  P1OUT |= BIT6; 									//ENABLES PULSE BY THE 'AND' GATE
                    	  PJOUT |= BIT0;									//ENABLES TTL TO RS232 CONVERTER (FOR DIFF OUTPUT)
							if(badPulse2==1){
								badPulse2=0;								// sets badPulse2 to 0 again so the ISR will generate the pulse
								P2OUT ^=BIT4;                            //generates 1pps out of p2.4
							}
                     }


                     }

    	else {																//EXTERNAL MODE
    		PJOUT |= ~(BIT3);            //sends '0' from pj.3 output to the multiplexer U4 (uses the external 1pps)
    		P1OUT |= BIT6;      			// ENABLES PULSE 1
    		P1OUT |= BIT7;				//ENABLES PULSE 2
    		PJOUT |= BIT0;				//ENABLES RS422 DIFF OUTPUT	FOR PULSE 1
    		PJOUT |= BIT1;				// ENABLES RS422 DIFF OUTPUT FOR PULSE 2
    	    	}
    	}
		
}

	
	
                    //ISR FOR TIMERD0.0 - NORMAL/BAD PULSE 1 AND 2
					
					
					
					#pragma vector = TIMER0_D0_VECTOR 				//GENERATES 1PPS EVERY 1s for normal pulse
                   __interrupt void TIMER0_D0 (void){
					   
					   //NORMAL PULSE 1 AND 2:
					   
                	   if (++timerCount > 500) {   						// checks if the incrementation of timerCount reaches 500 (means 1 second has passed)toggling means doubling the time this is why we need to devide the time to a half. (1000/2=500)
					                      timerCount = 0;             // resets the millisecond counter to 0
							       normalPulse1 = 1;             //once it reaches 500 (1 second) normalPulse1 will be 1 
							       normalPulse2 = 1;				//once it reaches 500 (1 second) normalPulse2 will be 1 
								 secondsCount++;
                	                  	   }
                	                  	  
                     
					// BAD PULSE 1 AND 2:
					
				
                	   if (secondsCount == 2) {   						// checks if the incrementation of secondCount reaches 2 seconds for bad pulse (means 2 second has passed)
									secondsCount = 0;             // resets the millisecond counter to 0
									badPulse1=1;					// once it reaches 2000( 2 seconds) the badPulse1 will be 1.
									badPulse2=1;					// once it reaches 2000( 2 seconds) the badPulse2 will be 1.
                	                  	   }
                	                  	   
}

I would be glad if you could look at the code and see if thats the right application for my project , ( the code has been compiled with no errors)

thanks

Starterware/MSP432P401R: Using Systick as a Timer

$
0
0

Part Number:MSP432P401R

Tool/software: Starterware

The driverlib starter code for the Systick module uses Interrupts.  Is there example code that uses Systick as a simple timer without Interrupts e.g. grabbing the current value for the timer?  I thought I could make a simple change to the Systick interrupt example code but I keep getting the following error: 

Description Resource Path Location Type
unresolved symbol SysTick_Handler, first referenced in ./startup_msp432p401r_ccs.obj Lab4 C/C++ Problem

CCS/MSP-FET: Loading code with SPY-bi-Wire onto msp430g2955 using MSP-FET but code is not halting at main()

$
0
0

Part Number:MSP-FET

Tool/software: Code Composer Studio

In the project explorer, our code implementation has a separate project for Boot Loader and the Application code.  When we load  the boot loader separately, the Debug mode halts correctly at the Boot Loader's main().  

Afterwards, when we separately load the Application image, when the loading completes the IDE does not halt at main().  Both the resume and the Suspend icons are gray,  When we click on the TI MSP430 USB1/MSP430 line of the debug window, then the "pause" icon goes yellow (implying that the code is running).

If we pause the code, the debugger stops, but not in an expected place.

for both the Boot and application code, the option "Replace written memory locations, retain unwritten memory locations" is enabled in the Build | MSP430x Options menu

we know this code and build options are functional with the MSP430g2553 processor using the LaunchPad. But we recast our target board using the MSp430g2955 using the MSP-FET device (this processor is not compatible with LaunchPad) and we are seeing this problem.

we have doubly checked that the code linker map has all the correct settings for the new processor (RAM/ROM/SFR locations).  And as we said before the boot code is operating correctly.   Are there any settings in CCS 6.1.3 that are required for the MSP-FET to work properly in this case?

Does SPY-bi-Wire have any limitations with the MSp430g2955 processor?

Viewing all 22391 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>