Reverse engineering the R6NT power meter

Reviews and other little ventures that don't quite fit into the other forums
Daniel Wee
Site Admin
Posts: 2442
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Reverse engineering the R6NT power meter

Post by Daniel Wee »

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
20210627_211157[1].jpg (2.43 MiB) Viewed 2119 times
Daniel Wee
Site Admin
Posts: 2442
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Reverse engineering the R6NT power meter

Post by Daniel Wee »

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/
Daniel Wee
Site Admin
Posts: 2442
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Reverse engineering the R6NT power meter

Post by Daniel Wee »

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 119 times
Daniel Wee
Site Admin
Posts: 2442
Joined: Wed 25 Feb 25 2009 8:00 pm

DMA headaches

Post by Daniel Wee »

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.

Code: Select all

extern "C" void DMA1_Channel1_IRQHandler(void) {
	HAL_NVIC_ClearPendingIRQ(DMA1_Channel1_IRQn);
	HAL_DMA_IRQHandler(&hDMA1_Channel1);
}
There is NO NEED to register the callback handlers other than to include it in the channel definition.
Daniel Wee
Site Admin
Posts: 2442
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: Reverse engineering the R6NT power meter

Post by Daniel Wee »

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
Attachments
KAUNE.pdf
(1.5 MiB) Downloaded 136 times
Post Reply