Convert small 64bit signed integer into a high and low byte ?


Author Message
bfwolf
Senior Member

Joined: 03/01/2025
Location: Germany
Posts: 246
Posted: 08:57am 16 Apr 2026      

  Volhout said  Hi bfwolf,

That is the correct way to do it, but in MMbasic that means you will need to poll in a loop until you do not an I2C error anymore. So MMBasic is busy.

So it is not better than a simple "PAUSE 6" (unless a particular fast I2C chip is ready in 4ms).

Regards,

Volhout


I just took a quick look at some I2C EEPROM datasheets from various manufacturers (which we have archived on a server at work) and noticed the following:

Many have "WriteCycleTime = max. 5ms", but the AT24C1024, for example, has 10ms — so 6ms might even be too short!

Sure, "PAUSE 6" is the easy way, which probably works 90% of the cases — but it can also sometimes be too short — or usually too long.

By the way, I initially thought "PAUSE 6" would pause for 6 seconds...

@phil99: Good example code shown!

Regards, bfwolf