6 ms·
This is pretty important right now, since there's tons of micros you literally cannot buy, some venerable 8-bitter lines are being cut off entirely and there's
by adhesive_wombat 4y ago
This is pretty important right now, since there's tons of micros you literally cannot buy, some venerable 8-bitter lines are being cut off entirely and there's a whole new RISC-V panoply coming down the tracks.
With C, you just need to rewrite the device drivers (because your business logic is portable and unit tested, right?!). In assembly, it's time to throw it all away and start again.
For a trivial programme like read the ADC and do something like alert on a UART, that's not so bad. But some products are a lot more complex than that.
- ddingus 4y agoOne could emulate those 8 bit CPU's and get good performance too. The bonus being able to continue using well tuned, mature routines. An emulation done once, would bring the whole works onto a new CPU.
- adhesive_wombat 4y agoMaybe, but a well-tested routine running in a new emulator is no longer well-tested. There's a careful value judgement to be made there. For example, if you have many products all in some dying 8-bit architecture, and it's easier to write the emulator once and then all the products are rescued, then good. If you spend 6 months writing the emulator to save yourself from 6 weeks of porting one simple program, less good. This is when "hey wouldn't it be really cool if" meets the cold realities of commercial engineering.
- ddingus 4y agoI have seen all sorts of stuff done small scale commercial. I agree with you. I took this particular case to mean there are lots of products. Could also just put the CPU into an FPGA, which would be a choice I would look hard at personally. Many 8 bitters are out there, some cycle exact. Then one has a hardware solution to build. Could go quicker.
- adhesive_wombat 4y agoWatch out for FPGAs this year: the prices are running something like 200x normal, if you can buy them at all. A $5 part is over $1000 on the grey market.
- ddingus 4y agoYes, prices and availability are all over the place. I personally would emulate. Over all, the take away is portability has more flex in it than is often recognized.
- Johnythree 4y agoOr you could simply learn the command set for a new micro. Once you are fluent in one, moving to another is no big deal.
- adhesive_wombat 4y agoMoving your skills might not be a big deal. Moving an entire mature application might be. Or it might not be. If it's just a simple loop, probably fine. If you have to move a custom assembly RTOS and an entire stack of business logic, maybe it's going to be very painful, project-risky and error-prone. Whereas if it was C, you just need to port drivers (which may already be provided by the manufacturer) and maybe do the RTOS port (if not already done). That could be days to weeks of work. A rewrite in a new assembly language could be months, at the end of which, to a customer, you have the exact same product you had before, except without a proven track record for any single byte of code. Like everything, it depends on the project. This year especially, it's going to be hard enough to stay alive by just shipping anything at all while competitors go to the wall under the double whammy of customer hesitancy and component shortages that can cut an established product of at the knees. And the last thing a company needs then is a long and expensive rewrite blocking shipping. Not only that, if the chips you rewrote for end up on 100 week lead times (and thats not even the longest I've seen this month), you're completely dead in the water.