Search found 59 matches

by DrBanana
Tue Oct 31, 2017 4:10 pm
Forum: General discussion
Topic: I2C freezes the STM
Replies: 8
Views: 208

Re: I2C freezes the STM

i2c_master_xfer has timeout parameter that wasn't used. I set it to 3 seconds and Init() the I2C if its times out. Seems to work fine.
by DrBanana
Tue Oct 31, 2017 3:22 pm
Forum: General discussion
Topic: I2C freezes the STM
Replies: 8
Views: 208

Re: I2C freezes the STM

i don't think there is anything that actually freezes the stm, but there are "freezes" that can be: - the code ending up in an error handler that just implements an infinite loop (but not sure if there are such handlers in the arduino core) - the peripheral ending in an error state, that isn't reso...
by DrBanana
Tue Oct 31, 2017 10:39 am
Forum: General discussion
Topic: I2C freezes the STM
Replies: 8
Views: 208

I2C freezes the STM

The I2C freezing the uC was problem of Arduino, but seems to happen in STM library too. The problem is, after some time I2C causes whole uC to freeze and it happens on random. To replicate the issue, one can short SDA and SCL pins for little time while I2C transmission is being done. After that uC w...
by DrBanana
Sun Oct 29, 2017 1:53 am
Forum: STM32F103 Boards
Topic: [SOLVED] AnalogRead problem
Replies: 11
Views: 277

Re: AnalogRead problem

Sorry guys, it was fault in schematics, so is in hardware.
by DrBanana
Thu Oct 26, 2017 11:47 am
Forum: STM32F103 Boards
Topic: [SOLVED] AnalogRead problem
Replies: 11
Views: 277

Re: AnalogRead problem

the wiring is good, hardware seems all good. I think the problem is in reading analog.
by DrBanana
Thu Oct 26, 2017 9:56 am
Forum: STM32F103 Boards
Topic: [SOLVED] AnalogRead problem
Replies: 11
Views: 277

Re: AnalogRead problem

If Vin is between 10 and 14 volts, Vout should be between 1.3 and 1.8V approx. http://www.calculatoredge.com/electronics/voltage%20divide.htm How do you get 2.0 to 2.6V ? I'm not sure I understand your circuit. Could be, I saw the waves in oscilloscope, nothings goes above 3v and was around 2v. The...
by DrBanana
Thu Oct 26, 2017 8:48 am
Forum: STM32F103 Boards
Topic: [SOLVED] AnalogRead problem
Replies: 11
Views: 277

Re: AnalogRead problem

Pito wrote:
Thu Oct 26, 2017 8:36 am
What are the resistor's values ?
12 VCC(+-2) - 10k + 1.5K - GND
by DrBanana
Thu Oct 26, 2017 8:31 am
Forum: STM32F103 Boards
Topic: [SOLVED] AnalogRead problem
Replies: 11
Views: 277

[SOLVED] AnalogRead problem

I have a voltage divider connected to PA4 pin of STM32F103RE Voltages on PA4 oscillate from 2.0 to 2.6 volts, but the analogRead on PA4 going way off. Here is the code void setup() { pinMode(PA4, INPUT_ANALOG); Serial.begin(9600); } void loop() { int analogValue = analogRead(PA4); Serial.println(ana...
by DrBanana
Thu Jul 20, 2017 9:44 am
Forum: General discussion
Topic: Using USART1 PA11 and PA12
Replies: 2
Views: 149

Re: Using USART1 PA11 and PA12

I misread datasheet, it was CAN RX/TX. :(
by DrBanana
Thu Jul 20, 2017 2:45 am
Forum: General discussion
Topic: Using USART1 PA11 and PA12
Replies: 2
Views: 149

Using USART1 PA11 and PA12

I do not use Usb or UsbSerial, how can I use USART1 with RX and TX ?