Search found 870 matches

by mnfisher
Sun Mar 10, 2024 11:47 am
Forum: General
Topic: Macro from external program memory
Replies: 6
Views: 267

Re: Macro from external program memory

There is a programming axiom "any program can be optimised by at least one instruction" - though taken to its logical conclusion it implies that the best programs have no instructions at all. I would suspect splitting some code to a second MCU will be quite tricky - why not just use one with more me...
by mnfisher
Sun Mar 10, 2024 7:26 am
Forum: General
Topic: Any Pin Interrupt
Replies: 6
Views: 195

Re: Any Pin Interrupt

Which MCU are you using. Some, such as the Atmega 328p in the Arduino only have hardware interrupts on specific pins. Other MCUs allow more pins to be used - look up custom interrupt in the Wiki. There is an Arduino library that mimics interrupts on any pin - but this just checks the pin state regul...
by mnfisher
Fri Mar 08, 2024 11:50 am
Forum: General
Topic: Macro from external program memory
Replies: 6
Views: 267

Re: Macro from external program memory

As Steve says - it's well worth looking if you can refactor your code. There are some fairly simple techniques that can be used to save memory - A couple of simple examples: replace switch statements with an array lookup table if you repeatedly print a string followed by a number then create a macro...
by mnfisher
Thu Mar 07, 2024 1:15 pm
Forum: Tips & Tricks
Topic: ESP32 Bluetooth SPP with IDF v5
Replies: 4
Views: 232

Re: ESP32 Bluetooth SPP with IDF v5

As another aside - there is also an option to use AT commands.
This requires the download of a component from espressif. I'll see if I can get it to compile. It's probably better to use the 'native' component - but it might be useful for some legacy programs.

Martin
by mnfisher
Mon Mar 04, 2024 9:49 pm
Forum: General
Topic: ESP32 power Power Management and sleep
Replies: 7
Views: 285

Re: ESP32 power Power Management and sleep

Hmm - something is awry with the BT - even using espressif examples. I upgraded to v5.2 (brave maybe - not sure I recommend this at the moment) - and get the message/error: I (569) coexist: coex firmware version: 77cd7f8 I (575) main_task: Started on CPU0 I (585) main_task: Calling app_main() I (615...
by mnfisher
Mon Mar 04, 2024 3:01 pm
Forum: General
Topic: ESP32 power Power Management and sleep
Replies: 7
Views: 285

Re: ESP32 power Power Management and sleep

I think most of the variants turn off BT when in sleep too. Not sure if there is an easy solution - unless the BT can get a fix for v5? As a cheat (and a test)- connect BT using C (use the example programs - can add to supplementary code - and rename app_main()) and see if it works with sleep. I can...
by mnfisher
Mon Mar 04, 2024 1:04 pm
Forum: General
Topic: ESP32 power Power Management and sleep
Replies: 7
Views: 285

Re: ESP32 power Power Management and sleep

https://docs.espressif.com/projects/esp ... connection.

Has some details - will take a little C and I suspect might not be supported on some variants

Martin
by mnfisher
Sun Mar 03, 2024 2:20 pm
Forum: User Components
Topic: CRC-16 Component
Replies: 17
Views: 6301

Re: CRC-16 Component

Hi Herman, I checked using the online checker - mentioned in the first post. There seem to be a range of algorithms / polynomials - and 0x8408 isn't one on that site. If you can post (or PM) your code = and result you are getting I'll take a look and see if i can work out what is going awry.. Martin
by mnfisher
Sun Mar 03, 2024 11:25 am
Forum: General
Topic: PIC18F25K22 UART ERROR
Replies: 183
Views: 62607

Re: PIC18F25K22 UART ERROR

Just done a quick test with esp32 and ToString$(.x) takes about 2uS for .x = 1234. Did you mean FloatToString$ - this took ~8uS (this on an esp32?) If you are using something slower - say an Arduino - then if you want to use floats then multiply by 100 (10 / 1000 depending how many digits accuracy) ...
by mnfisher
Sun Mar 03, 2024 8:11 am
Forum: General
Topic: PIC18F25K22 UART ERROR
Replies: 183
Views: 62607

Re: PIC18F25K22 UART ERROR

ToString handles a lot of cases.

Might be worth creating a simple NumToStr that is quicker - if the data allows. For example, output all the numbers as 3 digits (only allows 0..999) with leading 0s if necessary.

Martin