Search found 106 matches

by chrismas9
Wed Aug 28, 2019 2:31 pm
Forum: General Discussion and Questions
Topic: Using LSI instead of LSE
Replies: 6
Views: 212

Re: Using LSI instead of LSE

From the data sheet: Multispeed internal RC oscillator (MSI), trimmable by software, able to generate 12 frequencies from 100 kHz to 48 MHz. When a 32.768 kHz clock source is available in the system (LSE), the MSI frequency can be automatically trimmed by hardware to reach better than ±0.25% accurac...
by chrismas9
Tue Aug 27, 2019 3:38 pm
Forum: General Discussion and Questions
Topic: Using LSI instead of LSE
Replies: 6
Views: 212

Re: Using LSI instead of LSE

USB needs a 0.25% accurate 48Mhz clock.On the L4 this is normally derived from a PLL multiplier from LSE. LSI is very inaccurate and cannot be used for USB or UART. The MSI is ok for UART at commercial temp, but not for USB. The L4 can derive a clock from USB SOF (1 kHz) but I don't know if MicroPyt...
by chrismas9
Sun Aug 11, 2019 2:45 am
Forum: Other Boards
Topic: Teensy 4.0
Replies: 4
Views: 630

Re: Teensy 4.0

Rocky Song from NXP has ported MicroPython and OpenMV to the RT1060.

https://github.com/RockySong
by chrismas9
Fri Aug 02, 2019 1:02 am
Forum: Pyboard D-series
Topic: Programming a D-series in Win64
Replies: 7
Views: 390

Re: Programming a D-series in Win64

I had issues with dfuse demo on another recent MCU and have changed to STMcubeprogrammer on Windows. It seems to support the newer MCUs. You have to follow the instructions to completely remove the dfuse USB driver before installing STMcubeprogrammer. It took a few attempts to get the driver to upda...
by chrismas9
Wed Jul 17, 2019 12:20 pm
Forum: Other Boards
Topic: [STM32L471] Port for STM32 without USB connectivity
Replies: 4
Views: 175

Re: [STM32L471] Port for STM32 without USB connectivity

You also need to remove #define MICROPY_HW_ENABLE_USB (1) and define a REPL UART. Use mpconfigboard.h from the NUCLEO_L432KC port as a starting point. I did the L452 port based on the L432. It doesn't have USB enabled (no connector on NUCLEO board) and it compiles error free for L451 by just changin...
by chrismas9
Thu Jun 27, 2019 5:09 am
Forum: MicroPython pyboard
Topic: ADC measure negative voltage??
Replies: 23
Views: 885

Re: ADC measure negative voltage??

On Pyboard Aref is derived from the main 3V3 regulator. If you want really good absolute accuracy connect a reference to another ADC input and scale your reading with the reference reading. Taking a large number or readings and averaging them will help. 4 readings should give about one more bit, 16 ...
by chrismas9
Wed Jun 26, 2019 12:27 am
Forum: MicroPython pyboard
Topic: ADC measure negative voltage??
Replies: 23
Views: 885

Re: ADC measure negative voltage??

I think there is a typo in your formula. With 100k resistors you will need a small cap on the ADC input as switched cap ADCs will draw transient current spikes from the inputs. You don't say what MCU you are using but some STM32 ADC pins are completely intolerant of voltages outside supply and GND s...
by chrismas9
Tue Jun 25, 2019 3:10 pm
Forum: MicroPython pyboard
Topic: ADC measure negative voltage??
Replies: 23
Views: 885

Re: ADC measure negative voltage??

I have used the method suggested by @roberthh. Here's how it works. Say you want to measure down to -12V. Make a 5:1 voltage divider, eg 10k and 40k. Connect 10k between Aref (3V3) and ADC input. Connect 40k from ADC input to negative voltage. When Vin = 0V ADCin = 3.3 - (3.3 + 0)/5 = 2.44V. When Vi...
by chrismas9
Mon Jun 03, 2019 11:12 pm
Forum: General Discussion and Questions
Topic: PyBoard Timer Question
Replies: 7
Views: 502

Re: PyBoard Timer Question

If you can't find a software solution you could add an analog switch to select the input (PWM) or output waveform to the same ADC. Just stream the ADC as fast as you want and switch to output after enough time to capture some input cycles. Knowing the sample rate you can calculate the average phase ...
by chrismas9
Tue May 21, 2019 4:11 am
Forum: Other Boards
Topic: [STM32F412RG] porting micropython flash memory problems
Replies: 5
Views: 263

Re: [STM32F412RG] porting micropython flash memory problems

I recently did the F413 port. Unless you need Ethernet consider using it instead, or try using it as a starting point instead of F411. It needed a few changes to the port source files, not just a custom config. For example the generic F4 startup file does not support some interrupt vectors like SPI ...