Now try and update the firmware
if you a coder cannot write an error free program that takes character from a serial port and writes it to an lcd display HE IS AN IDIOT, should be fired on the spot and should be barred from programming or touching a microcontroller and/or soldering iron for life !
really ? update the program ?
let's analyse this for a second shall we ?
- if an interrupt comes: take the byte form the uart
- if the byte is 255 then the next byte is a command , if the byte is 254 the next byte is a character. (essentially if you receive 255 you toggle RS high , if you receive 254 you toggle RS low , if it is anything else you put it on the databus and cycle the WR strobe fo the display.
The bloody program can be 20 instructions in assembly.
Now, since the program is so small : the same program, when idle, simply scans the keypad and if a key hit is detected, debounces it and sends a single character out through the uart.
That is an endless for-next loop detecting a key , waiting a few cycles to detect the key is still valid , spit out a character , wait a few more cycles and then repeat if still the same , or continue with the next scan if key was released.
There's another 50 instructions.
Easily done in a simply cheapo pic processor. offloads the main cpu.
In the 34401 multimeter they use a VFD display that needs its own scanning. So in the idle loop you perform the display scanning.
i'm willing to bet the code in that 8051 is barely 500 bytes. Heck they use a MASK programmed 8051, not a flash , not an eprom , not even an otp. a MASK programmed one ! they don't need to update that code as it is bug-free.
[takes beer-crate, puts it down , gets on it and starts ranting]
This is the key problem causing the sorry state a lot of firmware is in these days. It sort of works, slap it in and ship it, we'll release bug fixes and updates later. Gone are the days of software where the programmer knew every in and out of his hardware and instruction set. gone are the days where a programmer would write bullet proof code, test the snot out of it and then be confident to have it cast in mask programmed rom.
It's all uniform drab slapped together from crap libraries written by some dolt that doesn't know any better.
Want an example ? Blu-ray and DVD players. Every time you buy a new disk this junk needs to connect to the internet for a 'software update'. I'm not even talking crypto encumbered stuff here. just its base firmware.
Take a modern DVD player , pop in a dvd disk. these machines have dual core processors running 800MHz these days with a 20 megabyte flash attached. They run effing linux ! [mandatory eyeroll] It sits there chewing for 30 seconds on the disk before it even shows the splashscreen.
the people writing such code should be tarred , feathered and have these dvd player shoved up their 'behind' sideways and put in stockades on public display.
i have an old daweoo dvd player. it has a stupid 16Mhz motorola 68000 and a little 8051 that does the keys, display and ir code. the EPROM (NOT FLASH !: one time programmable eprom) is a 27c512 ... it plays any DVD disk, even the latest release, without a single hiccup. close the tray and 3 seconds later you have an image. hit play and within a second the movie plays.
My latest greatest blu ray takes a minute before i get it to play. an then i need to sit there swearing at it becasue there is first the spinning disk splashscreen ,then the unskippable fbi warning , then the unskippable intro animation and then they gonna shove some previews of 'coming soon' movies down your throat (that you have already seen multiple times as you bough this disk 3 years after it was first released ,) that you can't skip either. Talk about taking the fun out of a movie night... Sometimes i want to fling the remote at the tv.
all because of the massive software overhead created by nitwit programmers that can only take massive, unoptimised (because all that shit needs to portable and reusable) third party libraries and kludge it together. if it contains bugs .. we'll fix it in the field afterwards through update.
We have the same shit in cars . toyota has had massive problems with engine controllers going crazy. A third party analysed the entire code and found 700 ! bugs. it is a miracle of programming that it worked right at all.
I just read Renault has to recall a bunch of cars because the cruise control systems can activate by themselves and go full throttle. you can't even shut them down. 3 people were killed because of it. oops, we haven't gotten that bit quite right yet , bring it in we'll update the software ....
really ? this is what the world has come to ? uniform crap ?
[steps off beercrate and goes for a walk to cool down...]
Really, if you cannot guarantee the correct functioning of something as simple as a little coprocessor doing some menial task that makes the main processors code easier you are in the wrong playing field. go back to toying with your Crapberry Pie and hard-whino.