3

I found in a stepper driver datasheet L6472 the following description:

enter image description here

What is the "unsigned fixed point 0.28 format"?

I found information about the fixed point format itself, but what does the 0.28 mean?

Is there an easy implementation for this conversion from [step/s] to SPEED in C on a micro-controller without floating point unit?

rkta
  • 3,959
  • 7
  • 25
  • 37
Corono
  • 35
  • 5
  • I means that the format is as given in the equation you show form the datasheet. If you don't want to use floating-point numbers, you're best leaving the number in the format of the SPEED register. The reason for the fixed-point representation is that you need to be able to represent numbers much smaller than 1. – Thomas Jager Jul 06 '20 at 17:02
  • 2
    0 bits before the radix point, 28 bits after it. – Nate Eldredge Jul 06 '20 at 17:13
  • just use it as an integer, do the math as needed, no need for fixed point. – old_timer Jul 06 '20 at 19:31

1 Answers1

4

The notation m.n for a fixed-point format means there are m bits representing an integer portion of a number and n bits represent a fractional portion of a number.

If you have m+n bits interpreted as some integer N, then the same bits would be interpreted as an m.n fixed-point number N/2n.

So, if you have 28 bits that, when interpreted as an integer, represent a value of N, then, when interpreted as a 0.28 fixed-point number, they represent a value of N/228.

Note that it is unusual for a register to have only 28 bits. If the register actually has 32 bits, then the high four bits should be ignored when interpreted the contents as a 0.28 fixed-point number, unless it is known they must be zero.

Eric Postpischil
  • 195,579
  • 13
  • 168
  • 312