Jump to content

emailcausey

Members
  • Content Count

    20
  • Joined

  • Last visited

  1. I am using ADCINA7 (pin J5.3) to measure the voltage from a pressure sensor (after being amplified by an INA333). I have attached 3 pictures. Picture #1: Y axis = voltage (mV), X axis = sample #. Picture #2: Exponential fit of curve from Picture #1 (in excel) Picture #3: Voltage (mV) after the exponential curve is subtracted I am noticing unexpected spikes that are most noticeable in Picture 3. I wish that I had the option of increasing the gain of the INA333, but that is not possible with my application. A former TI employee that I spoke with suggested that I use a 10 bit ADC instead of 12 bit ADC to prevent these spikes from occurring. At the time, this seemed like a great idea but, upon looking into it, I became uncertain if this is a possibility. Also, I am uncertain how to actually change the code so that it only uses a 10 bit ADC. I would appreciate suggestions either to convert the 12 bit ADC to 10 bits or other ideas of how I might remove these spikes. Thanks for the info!
  2. What is odd is if I make the array very large (100) then the first 15 values are inaccurate and the rest are accurate. Any ideas?
  3. emailcausey

    Array Errors

    The code below is working well. I have added an array to it (see purple bold text) and get expected values (arraypres[0]=100....array[9]=109). However, when I change it to uint16_t arraypres[20]; and if(number <20){ arraypres[number]=100+number; number = number+1; } I have unexpected results (see attachment). I am perplexed as to why this is happening. Any suggestions greatly appreciated. Code: #include "DSP28x_Project.h" // Device Header file and Examples Include File #include "f2802x_common/include/adc.h" #include "f2802x_common/include/clk.h" #include "f2802x_common/include/flash.h" #include "f2802x_common/include/gpio.h" #include "f2802x_common/include/pie.h" #include "f2802x_common/include/pll.h" #include "f2802x_common/include/pwm.h" #include "f2802x_common/include/wdog.h" #include "f2802x_common/include/spi.h" #include "f2802x_common/include/timer.h" // nokia5110 libraries #include "font8x8.h" #include "nokia5110.h" #include "stdio.h" // Prototype statements for functions found within this file. interrupt void adc_isr(void); void Adc_Config(void); interrupt void cpu_timer0_isr(void); interrupt void spiRxFifoIsr(void); void gpio_init(void); void spi_init(void); // Global variables used in this example: uint16_t interruptCount=0, val=0, arraymot[5], check=0; uint16_t j=0,i=0, a=0,AVG_VOLT=0,mV=0,ConversionCount = 0, LoopCount = 0,interval=900, y=0; //default interval is 15 min int16 level1=0, level2=0, level3=0, slope=16;//0.16 is the avg slope for LMV324 (should be 0.15 for INA333 slope) uint16_t baseline; uint16_t arraypres[10]; int16 number=0; long Voltage1[10]; long Voltage2[10]; long Voltage3[10]; long Voltage5[10]; long Voltage6[10]; long Voltage7[10]; long Voltage8[10]; long Voltage9[10]; long Voltage10[10]; long Mean_Volt3=0; long Mean_Volt7=0; long Mean_Volt10=0; long Peqn=0; long Peqn1=0; long Peqn2=0; long Sum_Volt3=0; long Sum_Volt7=0; long Sum_Volt10=0; ADC_Handle myAdc; CLK_Handle myClk; FLASH_Handle myFlash; GPIO_Handle myGpio; PIE_Handle myPie; SPI_Handle mySpi; CPU_Handle myCpu; PLL_Handle myPll; PWM_Handle myPwm1; WDOG_Handle myWDog; TIMER_Handle myTimer; char value0[10]; char value1[10]; char value2[10]; void main(void) { // Initialize all the handles needed for this application myAdc = ADC_init((void *)ADC_BASE_ADDR, sizeof(ADC_Obj)); myClk = CLK_init((void *)CLK_BASE_ADDR, sizeof(CLK_Obj)); myCpu = CPU_init((void *)NULL, sizeof(CPU_Obj)); myFlash = FLASH_init((void *)FLASH_BASE_ADDR, sizeof(FLASH_Obj)); myGpio = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj)); myPie = PIE_init((void *)PIE_BASE_ADDR, sizeof(PIE_Obj)); myPll = PLL_init((void *)PLL_BASE_ADDR, sizeof(PLL_Obj)); myPwm1 = PWM_init((void *)PWM_ePWM1_BASE_ADDR, sizeof(PWM_Obj)); myWDog = WDOG_init((void *)WDOG_BASE_ADDR, sizeof(WDOG_Obj)); myTimer = TIMER_init((void *)TIMER0_BASE_ADDR, sizeof(TIMER_Obj)); mySpi = SPI_init((void *)SPIA_BASE_ADDR, sizeof(SPI_Obj)); // Perform basic system initialization WDOG_disable(myWDog); CLK_enableAdcClock(myClk); (*Device_cal)(); //Select the internal oscillator 1 as the clock source CLK_setOscSrc(myClk, CLK_OscSrc_Internal); // Setup the PLL for x12 /2 which will yield 60Mhz = 10Mhz * 12 / 2 PLL_setup(myPll, PLL_Multiplier_12, PLL_DivideSelect_ClkIn_by_2); PIE_disable(myPie); PIE_disableAllInts(myPie); CPU_disableGlobalInts(myCpu); CPU_clearIntFlags(myCpu); // If running from flash copy RAM only functions to RAM #ifdef _FLASH memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize); #endif // Setup a debug vector table and enable the PIE PIE_setDebugIntVectorTable(myPie); PIE_enable(myPie); // Register interrupt handlers in the PIE vector table PIE_registerPieIntHandler(myPie, PIE_GroupNumber_10, PIE_SubGroupNumber_1, (intVec_t)&adc_isr); PIE_registerPieIntHandler(myPie, PIE_GroupNumber_1, PIE_SubGroupNumber_7, (intVec_t)&cpu_timer0_isr); // Configure CPU-Timer 0 to interrupt every second: // 60MHz CPU Freq, 1 second Period (in uSeconds) //ConfigCpuTimer(&CpuTimer0, 60, 1000000); TIMER_stop(myTimer); TIMER_setPeriod(myTimer, 60*1000000); TIMER_setPreScaler(myTimer, 0); TIMER_reload(myTimer); TIMER_setEmulationMode(myTimer, TIMER_EmulationMode_StopAfterNextDecrement); TIMER_enableInt(myTimer); TIMER_start(myTimer); // Initialize the ADC ADC_enableBandGap(myAdc); ADC_enableRefBuffers(myAdc); ADC_powerUp(myAdc); ADC_enable(myAdc); ADC_setVoltRefSrc(myAdc, ADC_VoltageRefSrc_Int); // Enable ADCINT1 in PIE PIE_enableAdcInt(myPie, ADC_IntNumber_1); // Enable CPU Interrupt 1 CPU_enableInt(myCpu, CPU_IntNumber_10); // Enable CPU INT1 which is connected to CPU-Timer 0: CPU_enableInt(myCpu, CPU_IntNumber_1); // Enable Global interrupt INTM // Enable TINT0 in the PIE: Group 1 interrupt 7 PIE_enableTimer0Int(myPie); CPU_enableGlobalInts(myCpu); // Enable Global realtime interrupt DBGM CPU_enableDebugInt(myCpu); // Configure ADC //Note: Channel ADCINA4 will be double sampled to workaround the ADC 1st sample issue for rev0 silicon errata ADC_setIntPulseGenMode(myAdc, ADC_IntPulseGenMode_Prior); //ADCINT1 trips after AdcResults latch ADC_enableInt(myAdc, ADC_IntNumber_1); //Enabled ADCINT1 ADC_setIntMode(myAdc, ADC_IntNumber_1, ADC_IntMode_ClearFlag); //Disable ADCINT1 Continuous mode ADC_setIntSrc(myAdc, ADC_IntNumber_1, ADC_IntSrc_EOC2); //setup EOC2 to trigger ADCINT1 to fire ADC_setSocChanNumber (myAdc, ADC_SocNumber_0, ADC_SocChanNumber_A4); //set SOC0 channel select to ADCINA4 - Interval ADC_setSocChanNumber (myAdc, ADC_SocNumber_1, ADC_SocChanNumber_A4); //set SOC1 channel select to ADCINA4 - Interval ADC_setSocChanNumber (myAdc, ADC_SocNumber_2, ADC_SocChanNumber_A7); //set SOC2 channel select to ADCINA7 - Pressure ADC_setSocChanNumber (myAdc, ADC_SocNumber_3, ADC_SocChanNumber_A3); //Motor ADC_setSocTrigSrc(myAdc, ADC_SocNumber_0, ADC_SocTrigSrc_EPWM1_ADCSOCA); //set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1 ADC_setSocTrigSrc(myAdc, ADC_SocNumber_1, ADC_SocTrigSrc_EPWM1_ADCSOCA); //set SOC1 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1 ADC_setSocTrigSrc(myAdc, ADC_SocNumber_2, ADC_SocTrigSrc_EPWM1_ADCSOCA); //set SOC2 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1, then SOC2 ADC_setSocTrigSrc(myAdc, ADC_SocNumber_3, ADC_SocTrigSrc_EPWM1_ADCSOCA); ADC_setSocSampleWindow(myAdc, ADC_SocNumber_0, ADC_SocSampleWindow_64_cycles); //set SOC0 S/H Window to 64 ADC Clock Cycles, (6 ACQPS plus 1) ADC_setSocSampleWindow(myAdc, ADC_SocNumber_1, ADC_SocSampleWindow_64_cycles); //set SOC1 S/H Window to 64 ADC Clock Cycles, (6 ACQPS plus 1) ADC_setSocSampleWindow(myAdc, ADC_SocNumber_2, ADC_SocSampleWindow_64_cycles); //set SOC2 S/H Window to 64 ADC Clock Cycles, (6 ACQPS plus 1) ADC_setSocSampleWindow(myAdc, ADC_SocNumber_3, ADC_SocSampleWindow_64_cycles); // Enable PWM clock CLK_enablePwmClock(myClk, PWM_Number_1); // Setup PWM PWM_enableSocAPulse(myPwm1); // Enable SOC on A group PWM_setSocAPulseSrc(myPwm1, PWM_SocPulseSrc_CounterEqualCmpAIncr); // Select SOC from from CPMA on upcount PWM_setSocAPeriod(myPwm1, PWM_SocPeriod_FirstEvent); // Generate pulse on 1st event PWM_setCmpA(myPwm1, 0x0080); // Set compare A value PWM_setPeriod(myPwm1, 0xFFFF); // Set period for ePWM1 PWM_setCounterMode(myPwm1, PWM_CounterMode_Up); // count up and start CLK_enableTbClockSync(myClk); gpio_init(); spi_init(); nokiaInit(); clear(); myGpio = GPIO_init((void *)GPIO_BASE_ADDR, sizeof(GPIO_Obj)); GPIO_setMode(myGpio, timeandreset, GPIO_19_Mode_GeneralPurpose); GPIO_setDirection(myGpio, timeandreset, GPIO_Direction_Output); GPIO_setHigh(myGpio, timeandreset); //Default is that the Omron is off GPIO_setMode(myGpio, LED1, GPIO_28_Mode_GeneralPurpose); GPIO_setDirection(myGpio, LED1, GPIO_Direction_Output); GPIO_setMode(myGpio, LED2, GPIO_29_Mode_GeneralPurpose); GPIO_setDirection(myGpio, LED2, GPIO_Direction_Output); GPIO_setMode(myGpio, LED3, GPIO_34_Mode_GeneralPurpose); GPIO_setDirection(myGpio, GPIO_Number_34, GPIO_Direction_Output); GPIO_setMode(myGpio, buzzer, GPIO_0_Mode_GeneralPurpose); GPIO_setDirection(myGpio, GPIO_Number_0, GPIO_Direction_Output); GPIO_setLow(myGpio, LED1); GPIO_setLow(myGpio, LED2); GPIO_setLow(myGpio, LED3); GPIO_setLow(myGpio, buzzer); int SBP; SBP = 120; int DBP; DBP = 110; while(1) { //arraypres[val] = 1; asm(" NOP"); val = interruptCount; //baseline pressure taken during first 5 seconds if (val==5){ //0 V pulse sent for 3 seconds GPIO_setLow(myGpio, timeandreset); } else if(val==8){ //Device pumps up for 40 seconds GPIO_setHigh(myGpio, timeandreset); } else if(val==48){ //At this point a 0 V pulse sent for 3 seconds to turn the Omron off GPIO_setLow(myGpio, timeandreset); } else if(val==51){ //Omron rests until interval is reached - LED remains turned on until interval is reached GPIO_setHigh(myGpio, timeandreset); if(SBP >= 160 || DBP >= 110) { GPIO_setHigh(myGpio, LED1); } if(SBP >= 140 && SBP < 160 || DBP >= 90 && DBP < 110) { GPIO_setHigh(myGpio, LED2); } if(SBP < 140 && DBP < 90) { GPIO_setHigh(myGpio, LED3); } } //buzzer sounds if higher level is reached if(val>51 && val<53 && (SBP >= 160 || DBP >= 110)) { level1=1; if(level1+level2+level3>2) { GPIO_setHigh(myGpio, buzzer); level2=0; level3=0; } } if(val>51 && SBP < 160 && DBP < 110 && (SBP >= 140 || DBP >= 90)) { level1=0; level2=1; if(level2+level3>2) { GPIO_setHigh(myGpio, buzzer); level3=0; } } if(val>51 && SBP < 140 && DBP < 90) { level1=0; level2=0; level3=1; } //buzzer turns off after 10s if(val>53){ GPIO_setLow(myGpio,buzzer); } if(val==interval){ interruptCount = 0; GPIO_setLow(myGpio, LED1); GPIO_setLow(myGpio, LED2); GPIO_setLow(myGpio, LED3); } } } /* functions */ void gpio_init(void){ // set up GPIO's for nokia //GPIO_setMode(myGpio, nokiaVcc, GPIO_0_Mode_GeneralPurpose); GPIO_setMode(myGpio, nokiaRst, GPIO_0_Mode_GeneralPurpose); GPIO_setMode(myGpio, nokiaDc, GPIO_0_Mode_GeneralPurpose); GPIO_setMode(myGpio, nokiaBlight, GPIO_0_Mode_GeneralPurpose); GPIO_setMode(myGpio, nokiaSce, GPIO_0_Mode_GeneralPurpose); //GPIO_setDirection(myGpio, nokiaVcc, GPIO_Direction_Output); GPIO_setDirection(myGpio, nokiaRst, GPIO_Direction_Output); GPIO_setDirection(myGpio, nokiaDc, GPIO_Direction_Output); GPIO_setDirection(myGpio, nokiaBlight, GPIO_Direction_Output); GPIO_setDirection(myGpio, nokiaSce, GPIO_Direction_Output); //GPIO_setPullUp(myGpio, nokiaVcc, GPIO_PullUp_Disable); GPIO_setPullUp(myGpio, nokiaRst, GPIO_PullUp_Disable); GPIO_setPullUp(myGpio, nokiaDc, GPIO_PullUp_Disable); GPIO_setPullUp(myGpio, nokiaBlight, GPIO_PullUp_Disable); GPIO_setPullUp(myGpio, nokiaSce, GPIO_PullUp_Disable); return; } void spi_init(void){ // enable Spia clock CLK_enableSpiaClock(myClk); //set up GPIO's for SPI GPIO_setPullUp(myGpio, nokiaMosi, GPIO_PullUp_Disable); GPIO_setPullUp(myGpio, nokiaClk, GPIO_PullUp_Disable); GPIO_setQualification(myGpio, nokiaMosi, GPIO_Qual_ASync); GPIO_setQualification(myGpio, nokiaClk, GPIO_Qual_ASync); GPIO_setMode(myGpio, nokiaMosi, GPIO_16_Mode_SPISIMOA); GPIO_setMode(myGpio, nokiaClk, GPIO_18_Mode_SPICLKA); // Resets the serial peripheral interface (SPI) SPI_reset(mySpi); // Initializes the serial peripheral interface (SPI) object handle SPI_enable(mySpi); // Enables the serial peripheral interface (SPI) transmit and receive channels SPI_enableChannels(mySpi); // Enable master mode SPI_setMode(mySpi, SPI_Mode_Master); // Enables the serial peripheral interface (SPI) masater/slave transmit mode SPI_enableTx(mySpi); // Sets the serial peripheral interface (SPI) character length SPI_setCharLength(mySpi, SPI_CharLength_8_Bits); // Sets the serial peripheral interface (SPI) clock phase SPI_setClkPhase(mySpi, SPI_ClkPhase_Normal); // Sets the serial peripheral interface (SPI) clock polarity SPI_setClkPolarity(mySpi, SPI_ClkPolarity_OutputFallingEdge_InputRisingEdge); // Enables the serial peripheral interface (SPI) interrupt SPI_enableInt(mySpi); // Sets the serial peripheral interface (SPI) baud rate SPI_setBaudRate(mySpi, (SPI_BaudRate_e)0x00); // enable the SPI SPI_enable(mySpi); // Set so breakpoints don't disturb xmission SPI_setPriority(mySpi, SPI_Priority_FreeRun); PIE_registerPieIntHandler(myPie, PIE_GroupNumber_6, PIE_SubGroupNumber_1, (intVec_t)&spiRxFifoIsr); PIE_enableInt(myPie, PIE_GroupNumber_6, PIE_InterruptSource_SPIARX); CPU_enableInt(myCpu, CPU_IntNumber_6); return; } interrupt void spiRxFifoIsr(void) { GPIO_setHigh(myGpio, nokiaSce); //set Sce high SPI_read(mySpi); // Issue PIE ack PIE_clearInt(myPie, PIE_GroupNumber_6); return; } interrupt void cpu_timer0_isr(void) { interruptCount = interruptCount++; // Acknowledge this interrupt to receive more interrupts from group 1 PIE_clearInt(myPie, PIE_GroupNumber_1); } interrupt void adc_isr(void) { Voltage1[ConversionCount] = ADC_readResult(myAdc, ADC_ResultNumber_1); //interval Voltage2[ConversionCount] = Voltage1[ConversionCount]*3300; Voltage3[ConversionCount] = Voltage2[ConversionCount]/4096; Voltage5[ConversionCount] = ADC_readResult(myAdc, ADC_ResultNumber_2); //pressure Voltage6[ConversionCount] = Voltage5[ConversionCount]*3300; Voltage7[ConversionCount] = Voltage6[ConversionCount]/4096; Voltage8[ConversionCount] = ADC_readResult(myAdc, ADC_ResultNumber_3); //motor Voltage9[ConversionCount] = Voltage8[ConversionCount]*3300; Voltage10[ConversionCount] = Voltage9[ConversionCount]/4096; Sum_Volt3=Voltage3[ConversionCount]+Sum_Volt3; //interval Sum_Volt7=Voltage7[ConversionCount]+Sum_Volt7; //pressure Sum_Volt10=Voltage10[ConversionCount]+Sum_Volt10; //motor //Clears screen periodically if(LoopCount == 99) { LoopCount = 0; clear(); } else LoopCount++; // If 30 conversions have been logged, start over if(ConversionCount == 29) { ConversionCount = 0; Mean_Volt3=Sum_Volt3/30; //Mean of interval Mean_Volt7=Sum_Volt7/30; //Mean of pressure Mean_Volt10=Sum_Volt10/30; //Mean of motor Sum_Volt3=0; Sum_Volt7=0; Sum_Volt10=0; if (val<5){ //baseline measured baseline=Mean_Volt7; } Peqn = (slope*Mean_Volt7-slope*baseline)/100; } else ConversionCount++; if(number <10){ arraypres[number]=100+number; number = number+1; } writeString(1,0,"Pressure:"); writeString(35,1,"mmHg"); writeString(1,2,"Voltage:"); writeString(35,3,"mV"); writeString(1,4,"Interval:"); int t=Mean_Volt7; //voltage from pressure sprintf(value0,"%d",t); writeString(1,3,value0); int y_2=Peqn; //pressure sprintf(value2,"%d",y_2); writeString(1,1,value2); if(Mean_Volt3<100){ writeString(1,5,"15 min"); interval=15*60; } else if(Mean_Volt3>=100 && Mean_Volt3<500){ writeString(1,5,"30 min"); interval=30*60; } else if(Mean_Volt3>=500 && Mean_Volt3<900){ writeString(1,5,"1 hr "); interval=60*60; } else if(Mean_Volt3>=900 && Mean_Volt3<1300){ writeString(1,5,"2 hrs "); interval=120*60; } else if(Mean_Volt3>=1300){ writeString(1,5,"3 hrs "); interval=240*60; } // Clear ADCINT1 flag reinitialize for next SOC ADC_clearIntFlag(myAdc, ADC_IntNumber_1); // Acknowledge interrupt to PIE PIE_clearInt(myPie, PIE_GroupNumber_10); i++; return; }
  4. Just a follow-up. I switched to the ADCINA7 pin (J5.3) and changed the sampling rate and all is well.
  5. I measured the current going to the LaunchPad with a multimeter and it was 155 mA. I read from the data sheet on the TI website (http://www.ti.com/lit/ds/sprs523j/sprs523j.pdf) that the max current consumption is 100 mA. I have attached a plot of some of my results as well. The y axis is the difference between the mean DAQ and LaunchPad values (in mV). Still trying to figure it out.
  6. Hello! I am currently running a code that measures the voltage through the ADCINA4 pin (J1.6) and displays the results on a LCD screen. I am manually changing the voltage with a potentiometer. I am doing this two ways: First, I used a USB to power the LaunchPad and viewed the results on Code Composer Studio (the LCD also displays the results viewed in Code Composer Studio simultaneously). Second, I used a battery (with a 3.3 V voltage regulator) to power the LaunchPad in standalone mode using the J3 pins (on the bottom right-hand side of the LaunchPad). Also noteworthy, I have f2802x_codestartbranch.asm and F28027.cmd in the project. Also, I put the third S1 switch in the down position in this standalone mode and all jumpers are connected. I compared the results of the C2000 LaunchPad with those on the DAQ (or multimeter...either works) and they are much more accurate and consistent when the LaunchPad is being powered with the USB. I looked for documentation on how to power the F28027 in standalone mode and I haven't seen anything so far. I would be greatly appreciative to be directed to a place where I could do more reading on powering the F28027 in standalone mode. Of course, suggestions on how to improve my setup are greatly appreciated as well.
  7. Thank you so much. I will try that.
  8. I am using the adc_soc example to convert an analog voltage signal to a digital one. The pins that the example uses are ADCINA (J1.6) and ADCINA2 (J1.8). I first connected J1.6 : 3.3 V pin J1.8 : GND pin and received very nice digital values of ~4096 and 0, respectively. What is important is that each of these functions individually. In other words, if I disconnect pin J1.8, for example, I still have a reading of 4096 V from J1.6. However, what I really want to do is measure the voltage signal from a battery pack (which is also divided by a voltage divider) which is equal to ~2.88 V. So, I connected J1.6 : 2.88 V J1.8 : analog GND and received digital values of ~3200 and ~250, respectively. Moreover, when I measure these pins individually these values change to ~1900 and ~1800. I realize that I need a good reference value (or I need to incorporate this into my code), but I am uncertain how I should proceed. I read that I need to do something with VREFLO and VREFHI, but that there are no pins designated for VREFLO and VREFHI. How should I set these reference values?
  9. I changed the contrast writeCommand(0xC0); // Set LCD Vop (Contrast) and it is working very well. I really appreciate your responses. Thank you so much.
  10. AHA! Tim you were right again. After arduously trying to reduce the size by going through each header file...without success....I then decided to replace the 28027_RAM_lnk.cmd with F28028.cmd from C:\ti\controlSUITE\device_support\f2802x\v210\f2802x_common\cmd. Why this one works and the other doesn't....I don't know. But I'm going with it. I now have scrambling letters on my screen, but I am just happy to see something! Now to get that scrambled mess into a message. Will keep you posted.
  11. I checked Project -> Properties -> Build, but only found two options for configuration: “Debug” and “Release”. I am currently using Debug. I tried using "Release", but this action caused the include file "C:\ti\controlSUITE\device_support\f2802x\v210" in the Project Explorer to be removed, causing errors. I added F2802x_generic_flash.cmd into the Project Explorer (with the 28027_RAM_lnk.cmd simultaneously being in the Project Explorer). After pressing debug I received many errors, such as "#10263 BEGIN memory range has been exceeded" "#10264 #10264 ROM memory range overlaps" Based on the second error it occurred to me that maybe the 28027_RAM_lnk.cmd should be deleted and replaced with the F2802x_generic_flash.cmd. I did this and it debugged without error. However, when I pressed “resume” the backlight turned off and I also received a message, ‘Can't find a source file at “C:/controlsuite_gitorious_dev/device_support/f2802x/version/f2802x_common/source/F2802x_DefaultIsr.c" Locate the file or edit the source lookup path to include its location.' This is the exact same thing that was happening in the past when I deleted the “28027_RAM_lnk.cmd” from the Project Explorer, which makes me think that it is necessary to keep this file. I tried clicking "Locate File" and added a source folder to my desktop with the F2802x_DefaultIsr.c code inside. This didn’t do anything. Is F2802x_generic_flash.cmd necessary? I didn't use it in the simple blinking light example problem (http://fortytwoandnow.blogspot.com/2012/08/c2000-piccolo-blinking-led.html). Not really certain where to go from here. I might try deleting header files again. Any suggestions?
  12. My apologies for posting to the other thread. I will stick to this one. I realized after doing another tutorial (http://fortytwoandnow.blogspot.com/2012/08/c2000-piccolo-blinking-led.html)%C2'> I was missing one important component. I had deleted the 28027_RAM_lnk.cmd which made my LCD turn off as soon as I pressed "resume." This is an important based on the following lines of code: #ifdef _FLASH memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize); #endif However, after adding this command file back in I am now getting errors related to having available memory. I have attempted to eliminate unnecessary header files, but I think I am down to what is necessary. In addition to the default settings I have added: Project -> Properties -> Build -> C2000 Compiler -> Include Options "C:\ti\controlSUITE\device_support\f2802x\v210" Project -> Properties -> Build -> C2000 Linker -> File Search Path "C:\ti\controlSUITE\development_kits\C2000_LaunchPad\f2802x_common\lib\driverlib.lib" After reading the RAM cmd file I also tried adding the header linker command file (<base>\DSP2802x_headers\cmd) directly to the project, but that didn't seem to work. Ideas?
  13. Finally after going through and changing each spi.h file to the updated version...so that each one included the following lines of code at the bottom: //! \brief Writes a byte of data to the serial peripheral interface (SPI) //! \param[in] spiHandle The serial peripheral interface (SPI) object handle //! \param[in] data The data value inline void SPI_write8(SPI_Handle spiHandle,const uint16_t data) { SPI_Obj *spi = (SPI_Obj *)spiHandle; // set the bits spi->SPITXBUF = (data & 0xFF) << 8; return; } // end of SPI_write() function I eliminated the SPI_Write8 error! Thanks a million Tim. However, I haven't seen the LCD come to life yet. Still troubleshooting. I will keep you posted.
×
×
  • Create New...