Reverse engineering the R6NT power meter
-
- Site Admin
- Posts: 2449
- Joined: Wed 25 Feb 25 2009 8:00 pm
Re: Reverse engineering the R6NT power meter
Okay, we have managed to get the graphics primitives working and written in ARM assembly for speed. This is producing decent image with acceptable speeds.
- Attachments
-
- 20210627_211157[1].jpg (2.43 MiB) Viewed 15533 times
-
- Site Admin
- Posts: 2449
- Joined: Wed 25 Feb 25 2009 8:00 pm
Re: Reverse engineering the R6NT power meter
Things to do:-
1. Write up the ADC DMA code and oversample at least 4 or 16-times.
- useful info:-
https://stm32duinoforum.com/forum/viewt ... _4229.html
https://www.stm32duino.com/viewtopic.php?t=515
https://www.stm32duino.com/viewtopic.php?t=312
https://stackoverflow.com/questions/612 ... mpled-data
2. Convert readings to scale of meter
3. Calibration of the ADC
- some useful video info here
https://www.youtube.com/watch?v=bMqs-al73zA
4. Colour scheme
https://www.colorspire.com/rgb-color-wheel/
1. Write up the ADC DMA code and oversample at least 4 or 16-times.
- useful info:-
https://stm32duinoforum.com/forum/viewt ... _4229.html
https://www.stm32duino.com/viewtopic.php?t=515
https://www.stm32duino.com/viewtopic.php?t=312
https://stackoverflow.com/questions/612 ... mpled-data
2. Convert readings to scale of meter
3. Calibration of the ADC
- some useful video info here
https://www.youtube.com/watch?v=bMqs-al73zA
4. Colour scheme
https://www.colorspire.com/rgb-color-wheel/
-
- Site Admin
- Posts: 2449
- Joined: Wed 25 Feb 25 2009 8:00 pm
Re: Reverse engineering the R6NT power meter
The STM32 comes with a fast 12-bit ADC but we probably need a bit more resolution which we will get by way of over-sampling the ADC 64-times, yielding an increase of 3-bits for a 15-bit approximated resolution.
- Attachments
-
- an118.pdf
- (410.95 KiB) Downloaded 5786 times
-
- Site Admin
- Posts: 2449
- Joined: Wed 25 Feb 25 2009 8:00 pm
DMA headaches
The key to getting the DMA interrupt working is to define a function to override the default handler. This has to be declared as an extern for it to work.
There is NO NEED to register the callback handlers other than to include it in the channel definition.
Code: Select all
extern "C" void DMA1_Channel1_IRQHandler(void) {
HAL_NVIC_ClearPendingIRQ(DMA1_Channel1_IRQn);
HAL_DMA_IRQHandler(&hDMA1_Channel1);
}
-
- Site Admin
- Posts: 2449
- Joined: Wed 25 Feb 25 2009 8:00 pm
Re: Reverse engineering the R6NT power meter
What we appear to have now is a PEP metering system
Here are some useful articles that discuss the differences between PEP and Pavg.
https://dl.cdn-anritsu.com/en-us/test-m ... 00929A.pdf
There seem to be some schematics where and AD8310 (logarithmic amplifier) is used to give the power reading.
https://www.lazure.net/Electronic-Proje ... atics.html
Here are some useful articles that discuss the differences between PEP and Pavg.
https://dl.cdn-anritsu.com/en-us/test-m ... 00929A.pdf
There seem to be some schematics where and AD8310 (logarithmic amplifier) is used to give the power reading.
https://www.lazure.net/Electronic-Proje ... atics.html
- Attachments
-
- KAUNE.pdf
- (1.5 MiB) Downloaded 5780 times