Search found 31 matches

by fredbox
Wed Mar 25, 2020 2:15 pm
Forum: General discussion
Topic: Changing the PWM frequency
Replies: 8
Views: 142

Re: Changing the PWM frequency

Here is a snippet from one of my projects with a 60khz square wave output on PA6; // set timer 3 to 60KHZ square wave on PA6 - T3C1 HardwareTimer pwmtimer(3); void setup() { pinMode(PA6, PWM); pwmtimer.pause(); pwmtimer.setPrescaleFactor(1); pwmtimer.setOverflow(1200 - 1); // 72MHZ / 1200 = 60KHZ pw...
by fredbox
Mon Mar 23, 2020 4:54 pm
Forum: STM32L4 based boards
Topic: LCD i2c for STM32 with ArduinoIDE.
Replies: 8
Views: 100

Re: LCD i2c for STM32 with ArduinoIDE.

by Juraj » Mon Mar 23, 2020 1:07 am use an Arduino library. they use the Wire library which has the same API on all platforms The "hello world" example from https://github.com/johnrickman/LiquidCrystal_I2C compiles without error for the STM32L476RG board. Sketch uses 14116 bytes (1%) of program sto...
by fredbox
Sat Mar 21, 2020 5:42 pm
Forum: STM32L4 based boards
Topic: Trying to port Arduino programs to STM32 boards.
Replies: 7
Views: 91

Re: Trying to port Arduino programs to STM32 boards.

If you want to use the PinName (PA_5) you will need to convert to a DigitalPin. pinMode(pinNametoDigitalPin(PA_5), OUTPUT); Then you can use the digitalWriteFast function that takes a PinName as a parameter: digitalWriteFast(PA_5, HIGH); delay(500); digitalWriteFast(PA_5, LOW); delay(500); or simple...
by fredbox
Fri Mar 06, 2020 3:28 pm
Forum: General discussion
Topic: Compile time so slow
Replies: 19
Views: 756

Re: Compile time so slow

Arduino 1.8.12 on Linux, STM core 1.8.0.
For a small program it takes 22 seconds to compile the first time.
After adding or deleting a line, recompiles take about 3 seconds.
by fredbox
Fri Feb 28, 2020 11:11 pm
Forum: General discussion
Topic: STM32F103VET6 availabilty
Replies: 9
Views: 317

Re: STM32F103VET6 availabilty

Multiple LEDs are blinking and USB serial is saying 'hello world.'
It took about 15 minutes to get it working. Half of that was figuring out where to connect the wires from the ST-Link.

Flash and ram are reporting the correct values on upload.
by fredbox
Fri Feb 28, 2020 4:16 am
Forum: General discussion
Topic: STM32F103VET6 availabilty
Replies: 9
Views: 317

Re: STM32F103VET6 availabilty

Thanks for posting the link to the VET6. I have a board with a STM32F103VCT6 that I never got around to creating a variant. It looks like the main difference is that the VCT6 has 256K flash instead of 512, and 48K ram instead of 64. All the pin names seem to be the same at first glance. Hopefully al...
by fredbox
Mon Feb 03, 2020 9:46 pm
Forum: General discussion
Topic: Two instances of HardwareTimer problem
Replies: 2
Views: 258

Re: Two instances of HardwareTimer problem

See http://gammon.com.au/interrupts section "Hints for writing ISRs".
by fredbox
Sun Feb 02, 2020 9:27 pm
Forum: General discussion
Topic: SerialUSB doesn't work on Maple Mini
Replies: 28
Views: 2124

Re: SerialUSB doesn't work on Maple Mini

You can simplify the led line to

Code: Select all

led = 1 - led;
If led is 0 then 1 - led = 1.
If led is 1 then 1 - led = 0.
by fredbox
Wed Jan 29, 2020 12:24 am
Forum: General discussion
Topic: [SOLVED]Interesting problem
Replies: 41
Views: 1555

Re: Interesting problem

If using libmaple, you may need enableDebugPorts(). See https://github.com/rogerclarkmelbourne/ ... sh_debug.h
by fredbox
Tue Jan 28, 2020 11:00 pm
Forum: General discussion
Topic: [SOLVED]Interesting problem
Replies: 41
Views: 1555

Re: Interesting problem

You might want to try the STM32 Cube programmer for your stlink. Test setup - STLink connected to SWD and power pins on blue pill. Both boot jumpers = 0. USB not connected. ./stm32CubeProg.sh 10 /tmp/arduino_build_151098/sketch_jan25a.ino.bin -s ------------------------------------------------------...

Go to advanced search