Hi,
I am making good progress with an ADC driver for the KINETIS devices but I have a question about the usage of the depth setting in the generic adc.[ch] files.
For a ADCConversionGroup with 5 channels and if we are collecting a group of 3 samples for each channel, so 15 samples in total, what should the depth be set to in the ADCDriver object?
Cheers,
Derek
Kinetis ADC driver
Moderator: utzig
-
- Posts: 49
- Joined: Mon Aug 11, 2014 6:40 am
Re: Kinetis ADC driver
Hi,
Attached are patches for an ADC implementation for KINETIS. It is a generic LLD driver and supports both the K20 and KL2x devices. It supports collecting multiple values for multiple sensors in both single pass and circular modes. It emulates the features of the STM32 driver but this driver gets one interrupt per ADC sample.
The demo is for the FREEDOM-KL25Z board. It calculates the temperature using the internal sensor and the bandgap voltage.
Critique away!
Cheers,
Derek
Attached are patches for an ADC implementation for KINETIS. It is a generic LLD driver and supports both the K20 and KL2x devices. It supports collecting multiple values for multiple sensors in both single pass and circular modes. It emulates the features of the STM32 driver but this driver gets one interrupt per ADC sample.
The demo is for the FREEDOM-KL25Z board. It calculates the temperature using the internal sensor and the bandgap voltage.
Critique away!
Cheers,
Derek
- Attachments
-
- 0001-KINETIS-SIM-PMC-fields-and-ADC-comments-to-support-A.patch.gz
- (1.52 KiB) Downloaded 281 times
-
- 0002-KINETIS-ADC-LLD-driver.patch.gz
- (5.08 KiB) Downloaded 295 times
-
- 0003-KINETIS-ADC-demo-for-FREEDOM-KL25Z.patch.gz
- (10.71 KiB) Downloaded 315 times
-
- Posts: 49
- Joined: Mon Aug 11, 2014 6:40 am
Re: Kinetis ADC driver
Improved ADC demo which uses the LEDs to indicate the current temperature.
Blue is cold, Red is hot and Green is just right.
Blue is cold, Red is hot and Green is just right.
- Attachments
-
- 0003-KINETIS-ADC-demo-for-FREEDOM-KL25Z.patch.gz
- (10.96 KiB) Downloaded 308 times
Re: Kinetis ADC driver
Although I don't use a Kinetis myself, I appreciate the amount of work you put into this.
I keep tweeting about it so people might join your effort.
~ Tectu
I keep tweeting about it so people might join your effort.
~ Tectu
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
-
- Posts: 49
- Joined: Mon Aug 11, 2014 6:40 am
Re: Kinetis ADC driver
Tectu,
Thanks!
In a much earlier thread you talked about using the Kinetis SPI to drive a display and touchscreen. Now we have something working would you be able to restart that? I think a display would be a good benchmark before adding DMA.
Derek
Thanks!
In a much earlier thread you talked about using the Kinetis SPI to drive a display and touchscreen. Now we have something working would you be able to restart that? I think a display would be a good benchmark before adding DMA.
Derek
-
- Posts: 49
- Joined: Mon Aug 11, 2014 6:40 am
Re: Kinetis ADC driver
ADC driver for KINETIS and example program in testhal/KINETIS/ADC released.
From the readme.txt
Share and Enjoy,
Derek
From the readme.txt
Code: Select all
The demo runs on an Freescale Freedom KL25Z board and demonstrates
the usage of the ADC.
It reads the internal temperature sensor. If the temperature drops
below 20C (68F) it turns on the blue LED. If the temperature rises
above 27C (81F) it turns on the red LED. Otherwise the green LED is
illuminated.
The internal bandgap voltage reference is used to calibrate the
results returned from the temperature sensor.
Share and Enjoy,
Derek
Re: Kinetis ADC driver
SpaceCoaster wrote:Tectu, In a much earlier thread you talked about using the Kinetis SPI to drive a display and touchscreen. Now we have something working would you be able to restart that? I think a display would be a good benchmark before adding DMA.
I am interested into that for sure. However, I now no longer have such a board available. I'll put such a board on my next order as it is cheap anyway. Obviously I have both, the displays and the corresponding software to drive them so we only have to wait for the board to arrive
~ Tectu
Who is online
Users browsing this forum: No registered users and 30 guests