Is ADC in STM32F103 can sample up to 3Msps? - arm

I'm new to stm32 micro controllers. I read in STM32F103 data sheet that it has 3 ADC converters capable to perform up to 1Msps each. Is it possible to utilize these 3 converters to sample 1 channel up to 3 Msps ? I'm guessing it is possible if I start conversion for each converter sequentially with time difference 0.333us between one converter to another. So I get 3 conversion result from 3 converter for every 1us duration.
Is it feasible ? please advice. Thanks.

STM32F4 have native triple-interleaved mode, also each channel is possible to work at 2.4 MSPS. Also no need in external shorting of 3 pins, just ADC1-ADC3 are setup for one chn. So the speed could be 7.2-8.4 MSPS (thereis an example in STM32F4Discovery program pack)

Related

stm32: PWM generator with 1/20 pulses

I'm struggeling on setting up a STM32-F429ZI MCU (Nucleo 144 board) to generate following PWM pattern:
First channel with a variable frequency and 50% duty cycle - at least I've got this working -
Second channel giving a pulse with each 20th pulse of channel 1.
This is not primary a coding problem but a understanding problem of timer settings i guess (working with STM32CubeIDE). I would bet there is real simple solution...
I Think there is no way to do this with only 1 timer?
I'm pleased for any suggestion...
I already tried with TIM2 as clock source for TIM3 and 4 but couldn't manage to make them synchonize.
For better illustration of what I want to do:
I't not sure, if it could be done with two timer synchronization (the pitfall is variable frequency of the first timer). But you can use single timer+DMA to rewrite configuration of the second channel:
Create in-memory array of 20 values, where one value enables the second channel and other 19 disables it
Setup DMA to trigger on the timer update and to move data from the array to CCMRx (or CCRx) register. Of cource, DMA should be in circular mode

How can I use a serial port to listen to if toggles are switched?

In my software I need to detect when an operator toggles one of two miniature toggle electric switches:
and which one.
I want to do this with as little external hardware as possible.
I was thinking that maybe I could use a USB to serial cable?
Looking at the WaitCommEvent documentation I notice that I can listen to for instance:
EV_CTS: The CTS (clear-to-send) signal changed state.
EV_DSR: The DSR
(data-set-ready) signal changed state.
Looking at the DB-9 pins:
It seems that I could connect a voltage source trough the toggle 1 to pin 8 (CTS) and to ground?
Likewise it seems that I could connect a voltage source trough the toggle 2 to pin 6 (DSR) and to ground?
Will this work? Is there a better way to do this only using a USB to serial cable?
For the sake of sparing you the work of reposting to the electronics exchange:
According to this document, setting CTS on means a voltage of at least +3V on the CTS line, relative to GND. Similarly, setting CTS off means a voltage of at least -3V on the CTS line, relative to GND. So you'd need two voltage sources, one for >+3V (GND to Serial GND) and one isolated one for <-3V (Plus to Serial GND).
DSR functions similarly, according to the document.
Also, your switch looks like an SPST. You'd need at least an SPDT for this if you want to avoid using resistors.

Control WVGA display with stm32f429-discovery LTDC

I am trying to output some data on the 7 inch TFT-LCD display (MCT070PC12W800480LML) using LCD-TFT display controller (LTDC 18 bits) on STM32F4.
LTDC interface setting are configured in CubeMx. In the program lcd data buffer is created with some values and it's starting address is mapped to the LTDC frame buffer start address.
At this moment display doesn't react to data sent by the LTDC. It only shows white and black strips, after i connect ground and power for digital circuit to the 3 volts source. VLED+ is connected to the 9 volts source. The VSYNC, HSYNC and CLOCK signals are generated by the LTDC and they match with specified values. I measured them on LCD strip, so the connection should be right. I also tried putting pulse on the LCD reset pin, but that doesn't make any sense.
The timing setting might be wrong.
LTDC clock is 33 MHz.
Here is the link to the diplay datasheet http://www.farnell.com/datasheets/2151568.pdf?_ga=2.128714188.1569403307.1506674811-10787525.1500902348 I saw some other WVGA displays using the same timing for synchronization signals, so i assume that timings are standard for that kind of displays.
Maybe signal polarity is wrong or i am missing something else. The program i am using now, worked on stm32f429-discovery build in LCD i just changed the timings. Any suggestions?
Thank you.
It could be something else, but I can see a problem with your timing values.
The back porch for both horizontal and vertical includes the sync pulses, but there must be a sync pulse width. My observation is that you have tried to get the total clocks for h = 1056 and v = 525 as per the data sheet by setting the sync pulses to 0. That won't work.
I would make the hsync pulse 20 and vysnc 10. The total clocks will be the same, but it is not critical that they match the spec sheet.

LMS implementation in LabVIEW fpga (High throughput personality)

Have to say surprised with the limitations of labVIEW FPGA in array implementation. I am not experienced enough in labview to make this comment but I found it very difficult to work with arrays !!.
I am working on Active Noise Cancellation project. I need to collect audio data from two microphones #40k Sample rate and 100 samples per frame (at least) and output the audio through loud speaker #40k sample rate. For this purpose, I am using myRIO 1900 in FPGA High throughput personality.
Right now, I am trying to implement LMS algorithm in LabVIEW FPGA platform. I have attached the MATLAB code below, what I want to implement !
Till array intializations are fine but when it comes to temporary vector manipulations. like :
x_temp(1:nr_c-1)=x_temp(2:nr_c);
x_temp(nr_c)=x(i);
I am going mad ! How to do this ? LabVIEW doesnt allow us to index the 1D arrays properly ( we can only extract one particular element of array not part of array, I can extract x_temp(1:nr_c) with sub array function but how to extract x_temp(2:nr_c) ??)
Please help me how to do the manipulation of 'x_temp' vector with the above basic statements.
PS: 1.LabVIEW FPGA supports only one dimensional array operations.
Even though Adaptive Filter Toolkit pallettes are available in myRIO FPGA High throughput personality, I cannot install Adaptive Filter Toolkit on myRIO Target.!!!
3.In MyLMS program : x : input vector(Array) , y: Desired Signal, nr_c : number of filter coefficients ,step: step size. I hope you understood the rest program :)
MyLMS.m :
function [y_hat,e,w] = MyLms(step, nr_c, x, y)
%intializing all vectors
coeffs=zeros(1,nr_c);
x_temp=zeros(1,nr_c);
y_hat=zeros(length(x),1);
e=zeros(length(x),1);
for i=1:length(x)
%temporary vector formation
x_temp(1:nr_c-1)=x_temp(2:nr_c);
x_temp(nr_c)=x(i);
%LMS algorithm iterations
y_hat(i) = x_temp * coeffs';
e(i)= y(i) - y_hat(i);
coeffs = coeffs+step*e(i)*x_temp;
end
I am by no means a LabVIEW FGPA expert, but I think you would encounter very similar limitations in VHDL.
At any rate, the typical technique for accessing subarrays is using rotate and replace subset (see Joel_G's post). For more information about the FPGA constraints and capabilities, see the help document: Array Palette Details (FPGA Module).

Configuration of ADC Renesas RX62N

I am using a Renesas RX62N; my screen uses ADC unit 1 and my code uses Unit 0.
Is it so that the two ADC units cannot work together? When I run the "ADC" and the "Display code" separately it works fine but as soon as I try to integrate them and get the ADC values on screen the variable stops to read!. Any solutions?
A quick look at the user manual indicates that you can use either the one 12 bit ADC or two 10 bit ADCs, but you cannot select the 10 and 12 bit ADCs simultaneously.
Thankyou all for your suggestions and time.
I was able to solve the issue. The problem as you pointed was that the 12 and the 10 bit adcs cannot work together and moreover all the channels in the 12bit are used up by my touchscreen. So by adding timers,delays and using DMAC I was able to finally get my ADC data to the display screen.
Regards
Ashish

Resources