Search found 22 matches
- Fri Jul 24, 2020 12:16 pm
- Forum: General discussion
- Topic: Using DMA ADC in combination with normal ADC?
- Replies: 1
- Views: 3509
Re: Using DMA ADC in combination with normal ADC?
[UPDATE] : After reading some reference manual (i should have read it before programming these actually lol), i think i should use injected ADC, while the ADC is busy reading voltage and current, trigger an injected ADC request, when injected channel is triggered the ADC abort all of its current ...
- Wed Jul 22, 2020 7:04 am
- Forum: General discussion
- Topic: Need more speed when changing PWM duty cycle.
- Replies: 5
- Views: 6995
Re: Need more speed when changing PWM duty cycle.
Yes, for 10uS interrupt, overflow is 720 ticks. But that is just interrupt. For pin pwm you can set other timer/values. For example, you can set overflow of pwm pin of 100 ticks. Nice round number, no need to calculate percentage, and you have 1% resolution of pulse that is 1.388uS long (720KHz ...
- Wed Jul 22, 2020 4:20 am
- Forum: General discussion
- Topic: Using DMA ADC in combination with normal ADC?
- Replies: 1
- Views: 3509
Using DMA ADC in combination with normal ADC?
Hello there,
I'm looking a way to use DMA ADC and normal ADC combined, the DMA ADC is used to measuring current and voltage of power supply (continous), while the normal ADC used to measure temperature of transistor (probably like once per second), when i read the ADC value of temperature, the DMA ...
I'm looking a way to use DMA ADC and normal ADC combined, the DMA ADC is used to measuring current and voltage of power supply (continous), while the normal ADC used to measure temperature of transistor (probably like once per second), when i read the ADC value of temperature, the DMA ...
- Wed Jul 22, 2020 1:49 am
- Forum: General discussion
- Topic: Need more speed when changing PWM duty cycle.
- Replies: 5
- Views: 6995
Re: Need more speed when changing PWM duty cycle.
I just realized that
mci1 = micros();
mci2 = micros() - mci1;
Itself takes around 12us to execute, DOH!. so the timer compare actually is fast?, so i guess the overhead problem was actually not on the setCaptureCompare, probably it was the micros() itself, or my getAverage().
So i changed my ...
mci1 = micros();
mci2 = micros() - mci1;
Itself takes around 12us to execute, DOH!. so the timer compare actually is fast?, so i guess the overhead problem was actually not on the setCaptureCompare, probably it was the micros() itself, or my getAverage().
So i changed my ...
- Tue Jul 21, 2020 2:49 pm
- Forum: General discussion
- Topic: Need more speed when changing PWM duty cycle.
- Replies: 5
- Views: 6995
Need more speed when changing PWM duty cycle.
Hello there,
Is there any way to sped up the speed of HardwareTimer::setCaptureCompare()?. I need it to be pretty fast, to be used on 100kHz timer interrupt, because i use it for my PWM-DAC on my digital power supply. I have tested the speed of setCaptureCompare on my BluePill and it was around 12us ...
Is there any way to sped up the speed of HardwareTimer::setCaptureCompare()?. I need it to be pretty fast, to be used on 100kHz timer interrupt, because i use it for my PWM-DAC on my digital power supply. I have tested the speed of setCaptureCompare on my BluePill and it was around 12us ...
- Sat May 02, 2020 11:44 am
- Forum: General discussion
- Topic: Starting ADC with DMA Mode causes chip to freeze
- Replies: 8
- Views: 9629
Re: Starting ADC with DMA Mode causes chip to freeze
It's working!, thanks a lot for the helps!
- Sat May 02, 2020 10:25 am
- Forum: General discussion
- Topic: Starting ADC with DMA Mode causes chip to freeze
- Replies: 8
- Views: 9629
Re: Starting ADC with DMA Mode causes chip to freeze
Ahhh, just realized it!, thanks for pointing it out!,
Will try it and see if it's going to work.
Will try it and see if it's going to work.
- Sat May 02, 2020 9:24 am
- Forum: General discussion
- Topic: Starting ADC with DMA Mode causes chip to freeze
- Replies: 8
- Views: 9629
Re: Starting ADC with DMA Mode causes chip to freeze
i can't see important parts in your code
at least i can't find init of analog pins, dma init and linking dma with adc
Im sorry this is my first time dealing with DMA, but i see a lot of cubeide tutorial and examples just using those functions to set up DMA and ADC.
or even stm32duino examples ...
- Sat May 02, 2020 7:05 am
- Forum: General discussion
- Topic: Starting ADC with DMA Mode causes chip to freeze
- Replies: 8
- Views: 9629
Re: Starting ADC with DMA Mode causes chip to freeze
You have to disable HAL ADC module usage by Arduino API because the MSP init is defined and I guess this is the reason why it freeze.
See this example:
https://www.stm32duino.com/viewtopic.php?f=41&t=110
To achieve this I simply disable the HAL ADC usage by the arduino API by defining -DHAL_ADC ...
- Sat May 02, 2020 2:23 am
- Forum: General discussion
- Topic: Starting ADC with DMA Mode causes chip to freeze
- Replies: 8
- Views: 9629
Re: Starting ADC with DMA Mode causes chip to freeze
using adc with Interrupt freezes my stm32 too, i guess i do something wrong.
#include <hd44780.h>
#include <hd44780ioClass/hd44780_pinIO.h> // Arduino pin i/o class header
#include "stm32f1xx_hal.h"
#include <HardwareTimer.h>
#define CH2_PWM PB7
#define LCD_RS PB12
#define LCD_EN PB13
#define LCD ...
#include <hd44780.h>
#include <hd44780ioClass/hd44780_pinIO.h> // Arduino pin i/o class header
#include "stm32f1xx_hal.h"
#include <HardwareTimer.h>
#define CH2_PWM PB7
#define LCD_RS PB12
#define LCD_EN PB13
#define LCD ...