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
Related
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
For a project I want to time how long a function takes. For this, I was thinking of using TimerA TA0 and a capture. However, after looking through the documentation, I was wondering if it is possible to capture the timer using an internal "message". In the datasheet (http://www.ti.com/lit/ds/symlink/msp430fr6989.pdf page 87, table at the bottom of the page) it is not really clear to me how to do this. It states the Port pins which can be used, but I am (obviously) not interested in that.
I was thus thinking if I was able to write to the TAxIV regitser, to just set the interrupt flag myself, but I'm absolutely not sure if it would work (I don't really think so, but I don't know why), I could use that to capture the timer.
I also already looked at the example code, but there they use ACLK to as an input signal. So that is not of much use either.
With kind regards and thanks in advance
As shown in the Timer_A block diagram (figure 25-1) in the User's Guide, the capture signal must come from one of the four capture inputs.
The last two inputs are always connected to GND and VCC, so you can trigger the capture manually by switching between these two inputs (see section 25.2.4.1.1).
The answer is (all thanks go to CL. ,see above, who gave the answer):
for initialisations:
TA0CCTL1 = CM_3 | CCIS_1 | SCS | CAP; // could put in interrupt here
TA0CTL = TASSEL__SMCLK | MC__CONTINUOUS; // setting the timer up with the SMCLK
and for usage, meaning capturing the timer:
TA0CCTL1 ^= CCIS0 // TA0CCR1 = TA0R, toggling the CCIS0 bit to switch between Vcc and GND
and then just reading the capture register out.
This answer is here to make it easier to read, for the full answer see my conversation with CL. above, whom gave me the answer.
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.
I am trying to implement PWM LED dimming in 6 stages, where each stage in more bright, based on clicking button, which increments external pin, which serves the value to timer.
I am facing a problem, that sometimes, value variable is too large than it should be and skips some levels of brightness. For example, value increments: 1,2,3, then jumps to 6,7, etc.
Can anybody pinpoint where is the mistake I am making.
Here is the code:
//EDIT: code removed, because it is a school assignment
This looks like contact bouncing. When input is processed by the CPU, a simple way to solve it is to disable input for a certain duration after an event is detected. Since you directly control timer input from a button, you may not have much control. However, I would experiment with the ETF field of the SMCR register (which in your case is likely set by the sClockSourceConfig.ClockFilter field) and the clock divisor CKD of the CR1 register (which seems like htim2.Init.ClockDivision in your code) (sorry, I am not familiar with STM libraries).
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)