Jump to content

Search the Community

Showing results for tags 'voltage'.



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.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 6 results

  1. SamSMK

    Battery voltage reader.

    I have made this code with my group now we want to edit it and make the code read voltage of a battery but we're not sure how to edit it because the professor want it in the same form as below and by the simple C Please don't forget to put comments so I would know what you actually changed float ThresholdExceeded = 0; char x[] = " out of 3.3v \n"; volatile unsigned int i=2001; void setup() { ADC12CTL0 = ADC12SHT02 + ADC12ON; // Sampling time, ADC12 on ADC12CTL1 = ADC12SHP; // Use sampling timer ADC12IE = 0x01; // Enable interrupt ADC12CTL0 |= ADC12ENC; P6SEL |= 0x01; // P6.0 ADC option select P1DIR |= 0x01; // P1.0 output P4DIR |= 0x80; // P4.7 output Serial.begin(9600); } void loop() { ADC12CTL0 |= ADC12SC; // Start sampling/conversion __bis_SR_register(LPM0_bits + GIE); // LPM0, ADC12_ISR will force exit __no_operation(); // For debugger /* Serial.println(ThresholdExceeded); */ if(i<1000) // continuous loop { P1OUT |= BIT0; // P1.0=1 /* for(i=50000;i>0;i--); */ // Delay } else { P1OUT &= ~BIT0; } // P1.0 = 0 Serial.println(i); i=i+1; } #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector = ADC12_VECTOR __interrupt void ADC12_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(ADC12_VECTOR))) ADC12_ISR (void) #else #error Compiler not supported! #endif { switch(/*__even_in_range(ADC12IV,34)*/ADC12IV) { case 0: break; // Vector 0: No interrupt case 2: break; // Vector 2: ADC overflow case 4: break; // Vector 4: ADC timing overflow case 6: // Vector 6: ADC12IFG0 if (ADC12MEM0 >= 0xFA0) // ADC12MEM = A0 > 0.5AVcc? {i=0;} /* {P4OUT &= ~BIT7; // P4.7 = 0 P1OUT &= ~BIT0; } // P1.0 = 0 /* else if (ADC12MEM0 <= 0x6d6) {P4OUT &= ~BIT7; // P4.7 = 0 P1OUT |= BIT0; } // P1.0 = 1 else if (ADC12MEM0 <= 0x794) {P4OUT |= BIT7; // P4.7 = 0 P1OUT |= BIT0; } /*else {P4OUT &= ~BIT7; // P4.7 = 1 P1OUT &= ~BIT0; } // P1.0 = 1 */ __bic_SR_register_on_exit(LPM0_bits); // Exit active CPU case 8: break; // Vector 8: ADC12IFG1 case 10: break; // Vector 10: ADC12IFG2 case 12: break; // Vector 12: ADC12IFG3 case 14: break; // Vector 14: ADC12IFG4 case 16: break; // Vector 16: ADC12IFG5 case 18: break; // Vector 18: ADC12IFG6 case 20: break; // Vector 20: ADC12IFG7 case 22: break; // Vector 22: ADC12IFG8 case 24: break; // Vector 24: ADC12IFG9 case 26: break; // Vector 26: ADC12IFG10 case 28: break; // Vector 28: ADC12IFG11 case 30: break; // Vector 30: ADC12IFG12 case 32: break; // Vector 32: ADC12IFG13 case 34: break; // Vector 34: ADC12IFG14 default: break; } ThresholdExceeded = ADC12MEM0; }
  2. Hello i have seen article about reading the supply voltage from MSP430 http://www.elevendroids.com/2013/06/code-recipe-reading-msp430-power-supply-voltage-level/ It can be usefull when running on batteries however i am not able to find anything suitable to use for TM4C123. The system DEFINES carries another names and the code can not be used. I have only used Energia for programming my LM4F120. If anyone have some experience in reading the internall VCC a and Voltage Reference to compute supply voltage level on TM4C123 I would be thankfull.
  3. Hi! Just a few questions: What is the default reference voltage for the analogRead() function on a msp430 g2553 ? Is it the internal Vcc ? How can I read the exact reference voltage correctly? Is there an option to change the reference voltage? Thanks in advance! kind regards, s1ck
  4. Hi, I'm getting to grips with a Launchpad ek-tmc123gxl board, and so far it looks amazing. However I have hit a snag which is pretty painful. Consider the following code: #include <stdbool.h> #include <stdint.h> #include "inc/hw_gpio.h" #include "inc/hw_memmap.h" #include "inc/hw_sysctl.h" #include "inc/hw_types.h" #include "driverlib/gpio.h" #include "driverlib/pin_map.h" #include "driverlib/rom.h" #include "driverlib/rom_map.h" #include "driverlib/sysctl.h" void setup(void); #define delay(x) SysCtlDelay((SysCtlClockGet() / 3000000) * x) uint8_t sequence_1[16] = { 0x4b, 0x4e, 0xcd, ... other 8-bit values }; uint8_t sequence_2[16] = { ... another list of 16 8-bit values like sequence_2 }; int index; int main() { int i, wait; setup(); index = 0; wait = 1000; while(1) { delay(wait); GPIOPinWrite(GPIO_PORTB_AHB_BASE, 0xFF, seq_m1[index]); GPIOPinWrite(GPIO_PORTD_AHB_BASE, 0xFF, seq_m2[index]); if(++index == 16) index = 0; } void setup(void) { // Set the clocking to run directly from the PLL at 80 MHz. SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB); SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOB); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOD); GPIOPinTypeGPIOOutput(GPIO_PORTB_AHB_BASE, 0xFF); GPIOPadConfigSet(GPIO_PORTB_AHB_BASE, 0xFF, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD); GPIOPinTypeGPIOOutput(GPIO_PORTD_AHB_BASE, 0xFF); GPIOPadConfigSet(GPIO_PORTD_AHB_BASE, 0xFF, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD); } I am seeing how pins D0 and D1 and B6 and B7 show the following scope trace: Where a normal binary squarish wave should be seen, I'm getting two high states, one at 1.85 V and another at the nominal 3.3 (!). I provide the facts below for context: The Launchpad board is brand-new. This behavior is also what I get when using an equivalent Energia sketch. None of the Port B or D pins are connected to anything. Just to the scope probes. This code is compiled on CCSv6 and arm-gcc. Same behavior. The usage of the AHB was just a "what if..." decision. The behavior is just as present when using the default APB. I suppose I'm missing a very big catch in dealing with the ports, but I thought the TivaWare drivers were written precisely to avoid this sort of unexpected and annoying behavior? As a more basic test, I made a program that toggles all bits of Ports B and D after a 2 ms delay. In that case, the scope showed a clean square wave. The ports configuration is identical to what I showed above. Thanks for the attention!
  5. Apaseo

    ADC and Voltage measurement

    Hello, I have an LCD working, and I also have an adc working to get voltage from a potentiometer. I am able to display adc values on the LCD, and they change when I change the value of the pot. But I am stuck with one thing, I know that it is a 10bit adc, which means it can only get 0x3FF different values of data. I have a DMM connected to the voltage from the pot, that same voltage is going to the adc on the msp340. Here are some of the values that I got: 5V--------->0x0000 4.5V------->0x009D 4V---------->0x0126 3.5V-------->0x01BD 3V---------->0x0249 2.5V-------->0x02DF 2V---------->0x036B 1.5V-------->0x3FD~(F) -----> Anything below 1.5v is not detected by the adc. Does anyone know of a way to get the adc to read the full range of the 5v? Thanks
  6. babisr

    Hi from Brazil

    Hi, I'm from Brazil! First thing I want to say: nice f
×