MSPM0_ValvanoWare  1.0
ECE445L starter code
Functions
ADC1.h File Reference

12-bit ADC input More...

Go to the source code of this file.

Functions

void ADCinit (void)
 Initialize ADC. More...
 
uint32_t ADCin (void)
 Input from PB18. More...
 
uint32_t Convert (uint32_t input)
 Input from PB18. More...
 
float FloatConvert (uint32_t input)
 Input from PB18. More...
 

Detailed Description

12-bit ADC input

12-bit ADC input on ADC1 channel 5, PB18

Version
ECE319K Spring 2024
Author
Your names go here
Warning
AS-IS
Note
For more information see http://users.ece.utexas.edu/~valvano/
Date
December 29, 2023
Pins for the 12-bit ADC
Pin GPIOHardware
PB18 inputconnected to slide-pot sensor

Function Documentation

◆ ADCin()

uint32_t ADCin ( void  )

Input from PB18.

Input from 12-bit ADC

Parameters
none
Returns
sample 12-bit conversion

◆ ADCinit()

void ADCinit ( void  )

Initialize ADC.

Initialize 12-bit ADC

  • PB18 analog input
    Parameters
    none
    Returns
    none
    Note
    LaunchPad_Init has been called; this program should not reset Port B

◆ Convert()

uint32_t Convert ( uint32_t  input)

Input from PB18.

Convert raw 12-bit ADC to fixed point distance

Parameters
input12-bit ADC raw sample
Returns
distance as 0.001cm fixed point number

◆ FloatConvert()

float FloatConvert ( uint32_t  input)

Input from PB18.

Convert raw 12-bit ADC to distance

Parameters
input12-bit ADC raw sample
Returns
distance as a floating-point number in cm