Skip to content

STM32 library for the 24bits ADC Analog Device AD7799

License

Notifications You must be signed in to change notification settings

axoulc/AD7799-STM32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Welcome to AD7799-STM32 👋

License: MIT License

STM32 library for the 24bits ADC Analog Device AD7799

Default Configuration (on startup or after reset)

  • Conversion mode : Continous
  • PGA Gain : 128
  • Channel : AIN1P-AIN1M
  • Polarity : Bipolar
  • Sample Rate : 16.7 Hz

What is not implemented ?

  • Continous Conversion

SPI Configuration

  • Data Size : 8bits
  • First Bit : MSB First
  • Baud Rate : up to 5 MBits
  • Clock Polarity : High (Mode 3)
  • Clock Phase : 2 Edge (Mode 3)

Usage

#include "AD7799.h"

AD7799 adc;

int main(void) {
	adc.adcspi = &hspi3; //Your SPI Handler
	adc.CSPort = ADC_CS_GPIO_Port; // Your CS Port
	adc.CSPin = ADC_CS_Pin; // Your CS Pin
	adc.vref = 3.0; // Your Voltage reference
	
	AD7799_Reset(&adc);
	if (AD7799_Init(&adc) != HAL_OK) {
	    Error_Handler();
	}
	AD7799_SetGain(&adc, AD7799_GAIN_64);
	AD7799_SetPolarity(&adc, AD7799_UNIPOLAR);
	
	if (AD7799_SingleConversion(&adc) != HAL_OK) {
	    Error_Handler();
	}
	printf("Raw value : %ld - Voltage Value : %f\r\n", adc.rawConversion, adc.voltConversion);
}

Author

👤 Axel Chabot

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2021 Axel Chabot.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

About

STM32 library for the 24bits ADC Analog Device AD7799

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages