Search found 7 matches

by Planet9
Fri Feb 21, 2020 10:56 am
Forum: General Discussion and Questions
Topic: Serial binary data packets using COBS and uasyncio
Replies: 6
Views: 4599

Re: Serial binary data packets using COBS and uasyncio

Thanks for your comments: Github - Peter has an excellent group of examples for uasyncio, perhaps this could be included there...with some tidy up first :-) New uasyncio - Yes, I should look at that when I get some time. Delimiter - COBS uses 0x00 as the frame delimiter and between blocks within the...
by Planet9
Thu Feb 20, 2020 6:01 pm
Forum: General Discussion and Questions
Topic: Serial binary data packets using COBS and uasyncio
Replies: 6
Views: 4599

Re: Serial binary data packets using COBS and uasyncio

Apologies for the lack of explanation here, hopefully the Cheshire & Baker paper is enough.
This is just a bare-bones code dump for anyone who might be interested in a micropython version of COBS.
by Planet9
Thu Feb 20, 2020 5:57 pm
Forum: General Discussion and Questions
Topic: Serial binary data packets using COBS and uasyncio
Replies: 6
Views: 4599

Re: Serial binary data packets using COBS and uasyncio

The following is a rudimentary COBS encoder/decoder for CPython. Setup the serial port appropriately to communicate with a pyboard, this code will send packets and look for an identical echo, as produced by the micropython code above. import serial,os from time import sleep from random import randin...
by Planet9
Thu Feb 20, 2020 5:54 pm
Forum: General Discussion and Questions
Topic: Serial binary data packets using COBS and uasyncio
Replies: 6
Views: 4599

Serial binary data packets using COBS and uasyncio

Sending binary data over a uart serial link can be a bit of a chore. One of the better ways is using COBS (Consistent Overhead Byte Stuffing) to packetise data. See the Cheshire & Baker paper linked at end of the wiki article: https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing Here is a...
by Planet9
Sat Dec 28, 2019 10:39 am
Forum: General Discussion and Questions
Topic: Surface mount soldering: can anyone help with two chips?
Replies: 10
Views: 5804

Re: Surface mount soldering: can anyone help with two chips?

Using low temp 60/40 solder might help.
I can supply you with a couple of S25FL128L in SOIC FOC if WSON doesn't work for you.
by Planet9
Sat Nov 23, 2019 9:11 pm
Forum: General Discussion and Questions
Topic: Detecting a beep with ESP32/micropython
Replies: 4
Views: 4286

Re: Detecting a beep with ESP32/micropython

The Goertzel algorithm is quite efficient when searching for a single tone. It essentially calculates one FFT bin. def goertzel(target_freq, sampling_freq, data): ''' When searching for a specific signal tone the Goertzel algorithm can be more efficient than fft. This routine returns magnitude of a ...
by Planet9
Tue Nov 12, 2019 7:36 pm
Forum: General Discussion and Questions
Topic: CAN on STM32F4xx
Replies: 12
Views: 8045

Re: CAN on STM32F4xx

Another option for testing is to eliminate the CANbus driver ICs and use Single Wire CAN. (1) Make the CAN TX lines open drain, as shown in this code (which is just a slight mod of previously posted code) (2) Join all the TX and RX lines from the STM32 MCU together (this is the Single Wire CANbus li...