Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

STM32F072 Pwm broken #245

Closed
chris-durand opened this issue Apr 25, 2017 · 5 comments
Closed

STM32F072 Pwm broken #245

chris-durand opened this issue Apr 25, 2017 · 5 comments

Comments

@chris-durand
Copy link
Member

chris-durand commented Apr 25, 2017

Pwm timers on STM32F072 are broken on some Gpio pins. The following example works perfectly for Output C9 on STMF072-Discovery, but generates no Pwm output when I use Output B1:

#include <xpcc/architecture/platform.hpp>

using namespace xpcc::stm32;

// ----------------------------------------------------------------------------
int
main()
{
	Board::initialize();
	
	GpioOutputC9::connect(Timer3::Channel4);
	
	// set up the timer for 16bit PWM
	Timer3::enable();
	Timer3::setMode(Timer3::Mode::UpCounter);

	Timer3::setPrescaler(1);
	Timer3::setOverflow(65535);
	// configure the output channels
	Timer3::configureOutputChannel(4, Timer3::OutputCompareMode::Pwm, 0);

	Timer3::applyAndReset();
	// start the timer
	Timer3::start();
	Timer3::setCompareValue(4, 20000);
	
	while (1)
	{
	}

	return 0;
}

This could be related to alternate function remapping.

@salkinium: We would really appreciate to have Pwm working on STM32F072 at the German Eurobot competition this weekend ;-)

@salkinium salkinium self-assigned this Apr 26, 2017
@salkinium
Copy link
Member

I'm flying over immediately for a VIP debug session. I'm not kidding.

@chris-durand
Copy link
Member Author

We will drive to Dresden on Friday morning.

@salkinium
Copy link
Member

salkinium commented Apr 26, 2017

And I'm coming with you! This is like last last minute planning.

@chris-durand
Copy link
Member Author

PEBCAK, hardware issue

@salkinium
Copy link
Member

Details: The pins PA2, PA3, PA6, PA7, PB0 and PB1 are not connected to the pinouts by default. To enable this we had to close the solderbridges SB27-SB32. However be aware of the routing of these pins on the PCB to the capacitive touch sensors, which include resistors and capacitors, and may influence the waveform on these pins.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants