Posted 20 hours ago

32 AMP Plug To 16 AMP Socket 240V Blue 4mm HO7RN-F Changeover Lead

ZTS2023's avatar
Shared by
Joined in 2023

About this deal

My test/demo code gives full 32 bits/16 bits with conversion/printing of results back to (up to) 10 digits of decimal (denary). I've just tried some simple code using bytes, to keep testing simple (using a word to represent your 32 bit field can use PICaxe's normal conversions), but it should work fine with word variables instead of bytes.

Cookies are used on this site to provide the best user experience and are used for ads personalisation. starts with 65/21 = 3, remainder 2 ; 24/21 = 1, remainder 3 ; 33/21 = 1, remainder 12, so the final answer is 311, remainder 12. Yes I looked at Jeremy's excellent documentation with interest and have filed it away for another day, but think it might be rather resource hungry for your specific requirement. You can create a 32-bit result from a 16-bit times 16-bit multiplication by multiplying only 8-bit values and getting 16-bit results, so it may be possible to somehow reverse that process. I believe the original request was for a (maximum) 16-bit result, but in principle I do quite like the idea of a 32-bit result as offered by womai and westaust.You could probably "bodge" the top bit with extra code, or just extend the code to 3 words/2 words as required. I don't claim to understand (yet) how hippy's code works, but have spotted a couple of minor typos, "DIVIDEN T" in the assignments and the remainder is not actually printed, but is correctly calculated in dividend.

I guess here must already be internal storage allocated for the 32 bit internal accumulator etc for multiply anyway.

I actually got your older 32/16 routine going perfectly in my application thanks, which takes around 10 msecs on an 18M2 running at a MHz clock rate and makes the logic of maths so much more hassle free with the headroom it gives. The ENCS63/415/S13/32/16 has a 63 Amp Panel Inlet by Mennekes and 9 different outlets, each protected by a Type A RCD and C Curve MCBs by ABB or Doepke. NextIn theory it's easy to do and the algorithm simple, but the implementation is the complicated thing. result is in w5, remainder in w2, w3 = 0As indicated by westaust, PICaxe basic does not support 16-bit by 16-bit multiplication so I certainly wouldn't expect native 32-bit divison.

That is where I personally would like to see PICaxe basic extended since IMHO the carry flag is so fundamental to microcontroller maths. I like the way you have reduced the word and byte registers required and the great documentation to go with it - very smart.This enables you to keep heat in when it’s cold and when it’s hot it will stay cooler inside of the canvas.

Asda Great Deal

Free UK shipping. 15 day free returns.
Community Updates
*So you can easily identify outgoing links on our site, we've marked them with an "*" symbol. Links on our site are monetised, but this never affects which deals get posted. Find more info in our FAQs and About Us page.
New Comment