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.

compdcm_mpu9150 SensorHub Example question?

Other Parts Discussed in Thread: TM4C123GH6PM

Hi, 

I am using the the SensorHub BoosterPack (BOOSTXL-SENSHUB) with the TM4C123GH6PM to measure the Euler's angles. Also, I do a code to recieve data from Matlab and its that's right. But, when I delete all the code of compdcm_mpu9150 and paste my code there are erros, the code  on  CCS is the following: 

#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "stdlib.h"
#include <math.h>
#include <time.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_uart.h"
#include "inc/hw_gpio.h"
#include "inc/hw_pwm.h"
#include "inc/hw_types.h"

#include "driverlib/timer.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/ssi.h"
#include "driverlib/systick.h"
#include "utils/uartstdio.h"
#include "utils/uartstdio.c"


int main (void){

		int buffer=0;
		int buffer2[11]; 
		
		int buffer3=0;
		int i=0, l;

SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
UARTStdioConfig(0, 115200, 16000000);

while(true){

		if(UARTCharsAvail(UART0_BASE) == true){

			
		    buffer= UARTCharGetNonBlocking(UART0_BASE)-48;
			   if(buffer == 67){

			   // built the number
			  //   ------------------------------------------------
			    for( l=0; l< i+1; l++){
			    		buffer3= (buffer2[l])*pow(10,(i-l-1))  + buffer3;
			    		
			    	}

				UARTprintf("data: %3d \n", buffer3);
				//refresh the values
				//-------------------------------
				buffer3=0;
				l=0;
				for( l=0; l< i+1; l++){
						buffer2[l]= 0;
					}
				l=0;
				i=0;
				
				}
				//----------------------------

			   else{
		    	       buffer2[i]= buffer;
		    	       i=i+1;
			   }
	    }

}
}

I do not know what is wrong, Coud someone help me?

Regards,

Jhon

  • There are a lot of things'wrong' with that code.

    What are the errors you are seeing?

    Robert
  • Hi Robert,

    I have those erros.

    Regards,

    Jhon

  • Not sure why you tagged your reply as an answer however, your errors suggest you are missing critical support libraries in your link. You'll need someone familiar with CCS to further guide you on that if that hint isn't enough.

    It's also possible that you do not have permission to write to the destination directory but that error may be misleading, a false alarm because of the link errors.

    Robert
  • jhon charaja casas said:
    I have those erros.

    The linker is reporting that the functions IntGPIOb, MPU915012CIntHandler and RGBBlinkIntHandler referenced from the startup_ccs.c source file are not present in the project.

    jhon charaja casas said:
    But, when I delete all the code of compdcm_mpu9150 and paste my code there are erros

    My guess is that the code of compdcm_mpu9150 contained interrupt handler functions IntGPIOb, MPU915012CIntHandler and RGBBlinkIntHandler. The interrupt handler functions are referenced in the vector table g_pfnVectors[] array in the startup_ccs.c source file. When you delete the interrupt handler functions from the example code you also need to remove the reference to the interrupt handler functions in the startup_ccs.c source file, by replacing the references in the g_pfnVectors[] array in the startup_ccs.c source file to IntDefaultHandler.

  • Hi Chester,

    Yes, You're right. I commented the interruptions, but I do not receive nothing on MatLab.

    I tested my code on other CCS project and it works.

    My code on MatLab is the following:

    clear all; close all; clc
    
    puerto = serial('COM5');    % creates an object that represent the port
    set(puerto,'Baudrate',115200);   % characteristics of the object
    set(puerto,'DataBits',8);
    set(puerto,'Parity','none');
    set(puerto,'StopBits',1);
    set(puerto,'FlowControl','none');
    fopen(puerto);     
    
    
    q='111s'; % generates the data that will be send
    fwrite(puerto,q,'char'); % writes the data on the port
    
    
    g=fscanf(puerto,'%d',500); 
    g    % shows the data
    
    fclose(puerto);  % closes the object
    delete(puerto); 
    clear puerto
    

    Regads,

    Jhon