Search found 144 matches

by Bakisha
Sun May 15, 2022 9:02 am
Forum: Projects
Topic: How do I adapt this 8 bit ladder DAC for STM32F401 Black Pill?
Replies: 7
Views: 3999

Re: How do I adapt this 8 bit ladder DAC for STM32F401 Black Pill?

RM0368, page 161

Code: Select all

GPIOA->BSRR = uint32_t ( bits );
In short, upper 16 bits of BSSR resets corresponding bits (1=reset, 0=don't change), and lower 16bit set corresponding bits (1=set, 0=don't change).
Set bits have priority over reset bits.
BSRR - Bit Set/Reset Register
Clipboard02.jpg
Clipboard02.jpg (94.21 KiB) Viewed 3976 times
by Bakisha
Sun Mar 13, 2022 8:20 am
Forum: General discussion
Topic: How to dynamically change duty cycle with HardwareTimer library?
Replies: 24
Views: 8328

Re: How to dynamically change duty cycle with HardwareTimer library?

To my understanding (as a hobby user) : setCaptureCompare is 0 indexed, CounterCompare Register (CCRx) is 0 indexed setOverflow is 1 indexed, Hardware AutoReload Register (ARR) is 0 indexed. setPrescaleFactor is 1 indexed, Prescaler register (PSC) is 0 indexed. To set duty cycle to 100% CounterCompa...
by Bakisha
Sat Mar 12, 2022 6:55 am
Forum: General discussion
Topic: How to dynamically change duty cycle with HardwareTimer library?
Replies: 24
Views: 8328

Re: How to dynamically change duty cycle with HardwareTimer library?

Hmmm, now even i am not sure anymore :lol: Goal was not to count cycles, but use setCaptureCompare to set 0% duty cycle with value 0, and 100% with value 255. And now i am not sure of that edge case. I think CounterCompare need to be greater than overflow to get 100% duty cycle. Overflow of 255 shou...
by Bakisha
Fri Mar 04, 2022 11:05 pm
Forum: General discussion
Topic: How to dynamically change duty cycle with HardwareTimer library?
Replies: 24
Views: 8328

Re: How to dynamically change duty cycle with HardwareTimer library?

- use "pwmTim->setCaptureCompare(..." as first line of code in interrupt callback. No matter how long you calculations are, interrupt latency is usually same, so you'll have steady timing. Plus, once value of counter-compare is written, it will apply that value in next timer overflow. From...
by Bakisha
Thu Feb 24, 2022 2:07 pm
Forum: General discussion
Topic: spikes/teeth in filtered PWM output waveform
Replies: 2
Views: 1407

Re: spikes/teeth in filtered PWM output waveform

IMHO, code is ok, maybe DSO138 is messing with you (screen antialiasing). Switch to uS range and look how much voltage ripple it have.
Or maybe too high LP filter capacitor. It will distort your waveform from saw to triangle.
Or, Instead of 50000, try with 250000 pwm frequency.
by Bakisha
Fri Feb 18, 2022 8:09 pm
Forum: General discussion
Topic: How to dynamically change duty cycle with HardwareTimer library?
Replies: 24
Views: 8328

Re: How to dynamically change duty cycle with HardwareTimer library?

This sounds like it would be useful for my application. Would you happen to have an example of this? My main hurdle with this is actually figuring out how to do the code. I'm definitely doing something wrong, but I haven't been able to change the duty cycle using the HardwareTimer library at all th...
by Bakisha
Sat Feb 12, 2022 12:15 pm
Forum: General discussion
Topic: How to dynamically change duty cycle with HardwareTimer library?
Replies: 24
Views: 8328

Re: How to dynamically change duty cycle with HardwareTimer library?

From my audio experiments with STM32, i found that using two timers gives excellent results. One timer is used for interrupt callback at samplerate (20uS for 50kHz, but can be much less), and second timer at much higher frequency (around 250KHz) of which you are changing duty cycle. Depending of you...
by Bakisha
Mon Jan 24, 2022 4:08 pm
Forum: General discussion
Topic: USB Composite + Roger Clark's Core, Serial over USB
Replies: 20
Views: 9745

Re: USB Composite + Roger Clark's Core, Serial over USB

I looked into driver itself on my computer, and it is using "USB serial driver" (Usbser.sys) that comes with Windows 10. If i'm right, and you are using Windows 7 (aero theme in your screenshot), google said that Windows 7 don't come with that driver. It might be a reason why your midi dev...
by Bakisha
Sun Jan 23, 2022 5:06 pm
Forum: General discussion
Topic: USB Composite + Roger Clark's Core, Serial over USB
Replies: 20
Views: 9745

Re: USB Composite + Roger Clark's Core, Serial over USB

There is also one more thing to try: USBComposite.setManufacturerString(ManufacturerName); USBComposite.setProductString(DeviceName); USBComposite.setSerialString(DeviceSerial); USBComposite.setProductId(0x0029); // or any other number than 0x0020 I wouldn't recommend it until you try other solution...
by Bakisha
Sun Jan 23, 2022 4:51 pm
Forum: General discussion
Topic: USB Composite + Roger Clark's Core, Serial over USB
Replies: 20
Views: 9745

Re: USB Composite + Roger Clark's Core, Serial over USB

Uf, windows and drivers... There is few thngs you can try: - right click on icons with problems, choose "uninstall" and click "scan for hardware changes" icon. - right-click, "update driver", "Browse my computer for drivers", select path "c:\Windows"...

Go to advanced search