Difference between revisions of "STM32F107VC/Using ADC"

From Teknologisk videncenter
Jump to: navigation, search
m (Software example)
m (Literature)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
=Literature=
 
=Literature=
 
*[http://www.e-books.dk/ebooks/chapter.cfm?chapid=ED0029 Analog-digitalkonvertering] (e-books.dk)
 
*[http://www.e-books.dk/ebooks/chapter.cfm?chapid=ED0029 Analog-digitalkonvertering] (e-books.dk)
 +
*[http://mars.tekkom.dk/data/embedded/STM32F107VC/stm32_ADC_Briefing_CD00258017.pdf STM32 ADC modes. (ST Application note AN3116)]
 +
 
=Software example=
 
=Software example=
*[http://mars.tekkom.dk/data/ad2.zip ad2.zip] (Example using RTX task triggering ADC conversion 100 times a second)
+
*[http://mars.tekkom.dk/data/AD2.zip ad2.zip] (Example using RTX task triggering ADC conversion 100 times a second)
*[http://mars.tekkom.dk/data/ad2.zip ad2timer.zip] (Same example as above. Just using timer 2 to trig ADC conversion 100 times a second)
+
*[http://mars.tekkom.dk/data/AD2TIMER.zip ad2timer.zip] (Same example as above. Just using timer 2 to trig ADC conversion 100 times a second)
  
 
==LDR - Light Dependent Resistor==
 
==LDR - Light Dependent Resistor==
*[http://www.cypax.com/pdf/PGM5526x.pdf LDR Datasheet] (Loads PDF)
+
*[http://www.cypax.com/pdf/PGM5526x.pdf PGM5526 LDR Datasheet] (Loads PDF)
 
The LDR is connected between [[STM32F107VC/GPIO|GPIO]] port C bit 0 and GND. A 10K pull-up resistor to 3.3V also connected to  [[STM32F107VC/GPIO|GPIO]] port C bit 0
 
The LDR is connected between [[STM32F107VC/GPIO|GPIO]] port C bit 0 and GND. A 10K pull-up resistor to 3.3V also connected to  [[STM32F107VC/GPIO|GPIO]] port C bit 0
 +
 
==Sample output from COM port==
 
==Sample output from COM port==
 
Baudrate: 9600
 
Baudrate: 9600

Latest revision as of 10:59, 5 March 2014

Literature

Software example

  • ad2.zip (Example using RTX task triggering ADC conversion 100 times a second)
  • ad2timer.zip (Same example as above. Just using timer 2 to trig ADC conversion 100 times a second)

LDR - Light Dependent Resistor

The LDR is connected between GPIO port C bit 0 and GND. A 10K pull-up resistor to 3.3V also connected to GPIO port C bit 0

Sample output from COM port

Baudrate: 9600

POT = 3.292V| LDR = 0.80V | DEG = 26.7C| Vrefint = 1.2075V
POT = 3.292V| LDR = 0.80V | DEG = 26.6C| Vrefint = 1.2076V
POT = 3.292V| LDR = 0.80V | DEG = 26.8C| Vrefint = 1.2071V
POT = 3.294V| LDR = 0.80V | DEG = 26.6C| Vrefint = 1.2075V
POT = 3.293V| LDR = 0.80V | DEG = 26.6C| Vrefint = 1.2074V