megaAVR mixing assembly with [gcc] C language, confusion (saving & restoring registers).

Go To Last Post
55 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

grohote wrote:

Math is demanding and register-hungry.

Float or 32b math does require a lot of registers, only 12 will survive.

 

Such programming tasks are certainly better solved with 32-bit controllers and high-level languages.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why, it works like a charm- I am using Float to handle BME280 routines.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

grohote wrote:
to handle BME280 routines

 

There are enough registers available for this purpose.

Such tasks should always be interruptible tasks of a main program.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I divided one sec to 32x32ms, so that everything can fit in an appropriate chunk. Handling of BME280 does needs 9ms with 8M clock, all that Temp/Baro/Humi floats.

Pages