Search the Community

Showing results for tags 'msp432;ccs;adc'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Found 1 result

  1. Hello Friends, Now I facing some problems with getting correct readings of ADC ports in MSP432. I Am using a multimeter to get the viability of the correct process. I am using CCS 7.0 and CMSIS mode writing code. My question... it's normal the measurements not be stable? I am using P5.5 pin port (A0) and this pin have different values of voltage, or any time change the value. It' is normal? I leave my code for get the readings for the ADC. #include "msp.h" /*DEFINE VAR LIKE A INTEGER*/ volatile int value_adc; void ADC_Initialize(void){ /*CONFIGURE LED OUTPUT*/ P1->OUT &= ~BIT0; /*CLEAR LEAD OUTPUT */ P1->DIR |= BIT0; /*SET DIRECTION OUTPUT*/ /*ADC CONFIGURATION*/ P5->SEL1 &= ~BIT5; /*CONFIGURE P5.5 (A0) FOR ADC*/ P5->SEL0 |= BIT5; /*ENABLE GLOBAL INTERRUPTS*/ __enable_irq(); NVIC->ISER[0] = 1 << ((ADC14_IRQn) & 31); /*ENABLE ADC INTERRUPT IN NVIC MODULE*/ ADC14->CTL0 &= ~ADC14_CTL0_ENC; /*CONFIGURE ADC14*/ ADC14->CTL0 = ADC14_CTL0_SHT0_2 | ADC14_CTL0_SHP | ADC14_CTL0_ON; /*ADC14 ON | S&H=16 | SAMPLING TIME*/ ADC14->CTL1 = ADC14_CTL1_RES_3; /*USE SAMPLE TIME, 14 BIT'S CONVERSION RESULTS*/ ADC14->MCTL[0] |= ADC14_MCTLN_INCH_0; /*A0 ADC INPUT SELECT Vref=AVCC*/ ADC14->IER0 |= ADC14_IER0_IE0; /*ENABLE ADC CONVERT COMPLETE INTERRUPT*/ SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; } void ADC_Task(void){ volatile unsigned int i; //P1->OUT ^= BIT0; for (i = 200000; i > 0; i--); /*DELAY CYCLE*/ ADC14->CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; /*ENABLE CONVERTION | SAMPLING CONVERSION*/ __sleep(); __no_operation(); } void ADC14_IRQHandler(void) { // if(ADC14->MEM[0] >= 0x7FF){ /*CONVERT DE SIGN OF CONVERTION IN A VARIABLE*/ value_adc = ADC14->MEM[0]; LCD_SetInt(value_adc,12 ,0); printf(value_adc); /*VERIFY IF THE INPUT PINS IS SET TO*/ //while(ADC14->CTL0 & ADC14_CTL0_BUSY); /*VOLTAGE CALCULATIONS*/ //value_vol = (value_adc * Vref_1)/digitalValue_1; // sprintf(adcData,"%2.2f",value_vol); // LCD_SetText(adcData,6 ,0); // temp = value_vol/gradeTemp; // sprintf(TEMP_C,"%2.2f",temp); // LCD_SetText(TEMP_C,0 ,0); //LCD_SetText(TEMP_C,0 ,0); /*CURRENT*/ // UART_Task(adcData,TEMP_C); /* if(value_adc > newValue_Adc){ P1->OUT |= BIT0; }else{ P1->OUT &= ~BIT0; }*/ //}else{ // LCD_SetText("ERROR",6 ,0); //} }