Hot answers tagged

54

Check that the GPIO pin for UART TX is configured for alternative output push pull mode. It looks like it is configured for alternative output open drain.


9

Your example is an ethernet interface, in which the connection to the magnetics isn't directly shown. But the input TPIN pair and the output TPOUT pair are connected to transformers (the "ethernet magnetics") which send or receive pulses down the twisted pair cable to the other ethernet devices. In practice, most designers will follow the datasheet's ...


7

Do you have a schematic for your circuit? In addition to the misconfigured GPIO pin, another possibility is that you have a capacitor on your UART line, acting as a low-pass filter, and preventing the signal from rising quickly.


4

I've found it. In the properties of the project, you need to go to C/C++ build -> Settings -> Tool Settings -> Includes. In the Include paths (-l), remove the HAL-related directories and add a catalogue with your own prepared drivers. Save the settings. The last step is to rebuild indexes.


3

Because the datasheet says so on page 7. For C30, in the text on page 7 on the right you'll find: Each VDD and VSS pin pair should have a 0.1uF ceramic bypass capacitor (not shown in the schematic) For C33 and L3, A look in the schematic tell us it's purpose shown with additional remarks: (Note that L3 is not an inductor, but a ferite bead!) These ...


3

The solution is to update the value synchronously instead of at random time. Perhaps in the overflow interrupt, if no other way is available. You don't say which STM32 you use, but some models have timers that have a preload feature which latch in the actual count from the register when counter starts a new cycle, you should fix your issue by enabling ...


3

As mentioned above, setting it to output push-pull mode will solve the problem, however you may also want to check the "Maximum output speed" is set to 'very high', and if your system tolerates it, add the internal pull-up resistors; I know there's various schools of thought on whether USART should have pullups or not, so try it and see if it does what you ...


3

I found the bill of materials for this board on the product page: It has these two descriptions for some crystals: So it looks like they are probably ±20 ppm. That is actually usually the tolerance over the full specified temperature range -- I'd expect even less variation at room temperature. However, you did state that the 8MHz crystal is actually not ...


3

I do not know much about coding.. but I cannot see the place where you are enabling the interrupts.. The interrupt for timer TIM3 can be enabled by adding the following line to the timer setup function: NVIC_EnableIRQ(TIM3_IRQn);


2

For example, if I'm using alternate function SPI1 SCK on pin PA5, is there no possible way to use pin PB7 for anything at all? Of course there is. Just remove solder bridges SB2 and SB3 and you'll have separate PA5/PA6 on pins 8/7 of CN3 and PB7/PB15 on pins 7/8 of CN4


2

Please read the datasheet and the user manual. In general, you can definitely use it separately. In this particular board you have limitations. As this is made to be Arduino nano board compatible.


2

Hopefully, you are past your issue now. Nevertheless, let me add an answer in case someone else stumbles upon the question in the future. USB specification requires that full-speed devices indicate their presence to the host by pulling D+ line to 3.0..3.6V via a 1.5 kOhms resistor. Based on the docs available at https://www.sparkfun.com/products/retired/...


2

This is what the Break functionality is for, as the reference below says Break input to put the timer’s output signals in reset state or in a known state. The break can be generated by the BRK input which has a programmable polarity and an enable bit BKE in the TIMx_BDTR Register. There are two solutions to generate a break: • By using the BRK ...


2

Please read the datasheet. Refer to external click crystal HSE characteristics.


2

The value of the crystal must be between 4-16Mhz.


2

You need to introduce some kind of protocol, or at least framing detection. SPI is just a stream of bytes if there is nothing else being done. 1) First transfer some initialization data to know when slave is present and in sync. Then continue with your normal packets. 2) Put a delay between packets on TX end and and put a shorter timeout on RX end. This ...


2

The MEM functios can directly read and write devices that have register address based access. They write the register addresss before reading or writing the register data. Most chips are like this. The non-MEM functions just do simple reads and writes.


2

UART is very robust when it comes to clock accuracy requirements. This is a consequence of the fact that each byte is processed independently and any time difference associated to clock mismatch doesn't propagate for more than 10 bits (start bit + 8 data bits + stop bit) in time. This analysis from Maxim concludes that 2% in clock frequency mismatch is ...


1

According to the board schematics, the USER button has a pull-down and pushing the button connects to supply voltage. So it idles low and is high when pushing the button.


1

If there isn't a specific signal to indicate a byte or packet boundary, you have two ways to deal with this: special sync pattern to figure out where the boundaries are idle pattern detection (kind of the same thing) To make this work in a general case, you might have to re-code your data payload in a way that ensures that it cannot include these special ...


1

Assuming a NOR flash you have to erase entire sector everytime when you have to update the contents of it, even if it is. Single byte. If the bootloader seldom does the wrote operation, it is okay to reserve the whole sector to store your flag. When you need to clear it, you have to erase the whole sector and wait until it is complete. I would like to ...


1

Have you enabled the Clock for the Power Module? It is kind of confusing that you have to enable something to reduce the power consumption. Deactivating all clocks of unused Peripherals will also lead to a major power reduction. We also measure higher current consumption while the controller is still connected to a debugger.


1

like Tagli said it's better to change CCxM than disabling the output but there is a case where you need the 2 channels (complentary pwm )to be low. so the solution for this is to change the polarity of one channel by setting CCxNP bit in the CCER register here is the modification in the code ( this part is only for 1 step) TIM1->CCMR1 |= ...


1

You have TIM_CR2_CCPC bit set, which makes CCxE, CCxNE and OCxM bits preloaded. The actual bits are updated when a COM event occurs. So I guess you need TIM1->EGR |= TIM_EGR_COMG; after changing those bits. However, disabling the output may not be the correct thing to do. Please consider updating CCxM bits to 0b100 or 0b101, which forces them to inactive ...


1

Place a 1 ohm resister in the source of your P channel drive fet Q2 .Measure the voltage across the resister with a scope .If you see big spikes like several volts then excess current is heating the Fet. More Inductance ,less on time ,More delay time will cool things down .Next place the scope between the Drain and ground noting a positive swing of ...


1

I managed to get the bootloader to work. I just needed to rename the reset_handler in the linker script and startup_stm32F40xx.s file to bootloader_reset_handler for the bootloader program.


1

You can offset the signal. simulate this circuit – Schematic created using CircuitLab The output of the circuit above is the input signal having an offset of VDD/2. I didn't show an exact value for C1 (coupling or DC blocking capacitor) because it depends on the frequency of the signal. Note that C1 and parallel combination of R1 and R2 form a hi-...


1

I wouldn't choose this tack, because the negative-going signal would not be within the range of allowable input signals on your microcontroller. Note that for the STM32f405 the absolute minimum input for a 5V tolerant pin is \$V_{SS} -0.3\$. The way this is done is to offset the input signal to be midrange for zero input, attenuating if necessary. Note ...


1

I had the same problem and after some headaches, I realized that the nucleo board I was using has the clock coming from the st-link locked in at 8MHz. CubeMX default settings had it set to 25MHz for me. Switching HSE to 8MHz (bypass mode) did the trick!


1

Never mind I found the answer. Naturally 5 minutes after posting this. I hadn't set up the reference voltage. Being used to AVR I was not aware that I needed this before programming it.


Only top voted, non community-wiki answers of a minimum length are eligible