EmbeddedRelated.com

Max (the Magnificent) Maxfield (@MaxMaxfield)

Clive "Max" Maxfield received his BSc in Control Engineering in 1980 from Sheffield Hallam University, England and began his career as a designer of central processing units (CPUs) for mainframe computers. Over the years, Max has designed everything from silicon chips to circuit boards and from brainwave amplifiers to steampunk Prognostication Engines (don't ask). He has also been at the forefront of Electronic Design Automation (EDA) for close to 40 years.

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/09/2023)
Very interesting -- thanks for sharing this -- as you say, this compiler is a smart beast (I fear it's creators are laughing at me :-)

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/02/2023)
But now it may be my new best friend (it's a funny old world :-)

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
Someone else said something similar -- this was one of my reasons for doing tests 0, 1, and 2 -- to determine the overhead of the if() and else-if() tests so I...

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
I had started to move this way -- actually using the result as part of a Serial.print() -- because that way the compiler knows I want a result -- but it was still...

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
I see what you mean -- this was one of my reasons for doing tests 0, 1, and 2 -- to determine the overhead of the if() and else-if() tests so I could subtract them...

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
Do I look like the sort of man who can make an array of pointers? Now I'm going to have to go and re-read my book on "Understanding and Using C Pointers" https://www.amazon.com/gp/product/1449344186...

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
How is it everyone knows about 'volatile' but me (LOL)?

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
Hi Jacob -- I've never even heard about volatile variables -- I learn something new every day!

Re: Help stop the Arduino compiler outwitting me

Reply posted 9 months ago (08/01/2023)
Thanks for the suggestion -- I will try this as soon as I get home tonight.

Help stop the Arduino compiler outwitting me

New thread started 9 months ago
It's me again (sorry). As a reminder, I'm a hardware design engineer, so my software knowledge is somewhat limited. I'm using the latest Arduino IDE 2 and I'm being...

Re: Visual Studio vs Visual Studio Code?

Reply posted 11 months ago (05/19/2023)
Thanks Jacob -- I was actually going to call you about this, but I know how busy you are so I thought I'd post the question here -- and lo and behold, you responded...

Re: Visual Studio vs Visual Studio Code?

Reply posted 11 months ago (05/19/2023)
That really helps -- Thanks Thomas

Visual Studio vs Visual Studio Code?

New thread started 11 months ago
I'm confused. I read that Visual Studio (VS is an IDE. I also read that Visual Studio Code (VS Code) is a source code editor (is this the editor used in VS?)But...

Re: Question re Servos

Reply posted 2 years ago (07/13/2022)
This all makes a lot of sense -- thanks for sharing :-)

Re: Question re Servos

Reply posted 2 years ago (06/21/2022)
Sage advice as always :-)

Re: Question re Servos

Reply posted 2 years ago (06/20/2022)
This is awesome advice -- thanks so much -- Max

Re: Question re Servos

Reply posted 2 years ago (06/20/2022)
Why, thank you, it's a pleasure to be here (whose turn is it to buy the beers? :-)

Question re Servos

New thread started 2 years ago
I'm a bit confused -- I recently started playing with servos. In the book "Motors for Makers" https://www.amazon.com/dp/0134032837 it says that 1.5ms pulses always...

Re: I Need a Test Specification Template

Reply posted 2 years ago (03/10/2022)
Hi there -- this is awesome -- thanks so much for taking the time to write this up -- I really appreciate it -- Max

I Need a Test Specification Template

New thread started 2 years ago
I'm sorry that this isn't related to embedded systems but I'm in a bit of a pickle. I have to write a test specification document for a vibration test for motorcycle...

Re: Advice on Re-schooling?

Reply posted 2 years ago (03/04/2022)
Thanks Jim -- I will do so -- Max

Re: Advice on Re-schooling?

Reply posted 2 years ago (03/03/2022)
Thanks Jeff -- I will pass this on -- Max

Re: Advice on Re-schooling?

Reply posted 2 years ago (03/03/2022)
Thanks Matthew -- I'm passing these responses on to my friend -- I'm hoping he will join Embedded Related and continue the discussion here.

Re: Advice on Re-schooling?

Reply posted 2 years ago (03/03/2022)
Thanks Steve -- I'm passing these responses on to my friend -- I'm hoping he will join Embedded Related and continue the discussion here.

Re: Advice on Re-schooling?

Reply posted 2 years ago (03/03/2022)
Thanks Jacob -- I'm passing these responses on to my friend -- I'm hoping he will join Embedded Related and continue the discussion here.

Advice on Re-schooling?

New thread started 2 years ago
I just heard from one of my contacts on LinkedIn – he sent me the following message (he told me I can share it) asking for advice:--------------------------So,...

Using noise to increase resolution of ADC

New thread started 2 years ago
Hi there -- can you explain in simple terms how – if you are feeding an analog signal into say a 4-bit analog to digital converter (ADC) with 16 digital output...

Brightness -> Gamma or Gamma -> Brightness?

New thread started 2 years ago
I have a bit of a conundrum -- when playing with LEDs, should we first modify brightness and then apply gamma correction, or should we apply gamma correction first...

Donut Mathematics

New thread started 2 years ago
Your knee-jerk reaction may be that this is not embedded related -- but even embedded designers have to have a hobby -- and I'm currently working on a project that...

Re: Determining the index of a value in a struct

Reply posted 3 years ago (08/06/2021)
I guess because I started off wandering down a certain path and just kept on going LOL

Re: Determining the index of a value in a struct

Reply posted 3 years ago (08/06/2021)
As you say, since we are using only byte-size fields in out union, this does work well. I'm just happy to have learned a new trick :-)

Re: Determining the index of a value in a struct

Reply posted 3 years ago (08/06/2021)
Hi Mr Firmware -- I totally agree regarding the naming -- personally I use Upper Camel Case for global variables and Lower Camel Case of local variables -- my example...

Re: Determining the index of a value in a struct

Reply posted 3 years ago (08/06/2021)
Hi Matthew -- thanks for the "heads-up" -- Max

Determining the index of a value in a struct

New thread started 3 years ago
This is based on some questions I posed (and you all answered) before. Suppose I have declared NUM_SETTINGS to be equal to 3. Let's also assume I've defined FRED...

Re: Formal Verification of Software

Reply posted 3 years ago (07/21/2021)
Make sure to keep your eyes open for my column on EEJournal.com thsi coming Thursday :-)

Re: Formal Verification of Software

Reply posted 3 years ago (07/20/2021)
Cool Beans -- How would you like to be referred to (name, position, link to LinkedIn)?

Re: Formal Verification of Software

Reply posted 3 years ago (07/20/2021)
Hi John -- Thanks so much for your response -- do you mind if I quote your response in a column I'm writing?

Formal Verification of Software

New thread started 3 years ago
I'm just trying to get a feel for things here. I'm a hardware design engineer by trade. I'm familiar with the concepts of formal verification with regard to designing...

Re: Variable Array Sizes when Instantiating?

Reply posted 3 years ago (06/29/2021)
Hi Jacob -- I wish I had you in the same room as a whiteboard!!!

Re: Variable Array Sizes when Instantiating?

Reply posted 3 years ago (06/29/2021)
Hi Daniel -- thanks foe your suggestion -- very clever -- I learn something new every day :-)

Variable Array Sizes when Instantiating?

New thread started 3 years ago
As always, I'm really sorry to bug you with a simple question (simple to you, not to me) -- I'll try to make this the last one for a while. I'm using an Arduino...

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/28/2021)
"Another approach [...] is the Fletcher's Checksum" I've never heard of that -- now I'm excited to learn something new -- I will Google that as soon as a get a...

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/28/2021)
Awesome feedback as always -- thanks so much Mathew -- Max

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/25/2021)
Awesome -- thanks as always for sharing -- Max
Dang -- I wish I'd known that years ago LOL

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/25/2021)
Ooh -- that is a great point -- I hadn't thought of that -- thanks for sharing.

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/25/2021)
"Don't go back to the dark pre-C99 days." But they were so exciting -- so much was unknown -- porting a program was full of mystery and adventure LOL

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/25/2021)
Hi Mr. Firmware -- this is great feedback -- thanks so much for taking the time to share. One thing I'm going to note in my column is that my project is a simple...

Re: Why CRC with EPROM?

Reply posted 3 years ago (06/25/2021)
Hi John -- thanks so much -- this is just what I needed -- Max
Re memcpy() not working -- that's what I thought (in my own slow "hardware-brained" way :-)But although I can understand your code, I fear it would be tricky for...
Most of the values in DefSettings are constant apart from the Checksum value -- speaking of which, I just posted another question (I'm sorry): https://www.embeddedrelated.com/thread/13888/why-crc-with-epromApart...

Why CRC with EPROM?

New thread started 3 years ago
On the one hand I feel guilty and embarrassed about asking all of my simplistic questions, but I always end up learning so much here.This relates to my previous...
But what if I want to copy the data from DefSettings to the EEPROM -- or from the EEPROM to WrkSettings? For the former (with my union), I was planning on using:   ...
It's heartening that I was almost there the first time -- all I needed was (a) Bob11's slight tweak and (b) a compiler that worked LOL. But it's awesome that VadimB's...
Hi Eric -- (a) I love this solution and (b) I wish I was more proficient at C/C++The problem is that I'm writing an article about a display project I'm building...
Hi Dilberto -- VadimB came up with a solution that works:Settings DefSettings = {    .vds = {        .vdMagicNum    = 0x42,        .vdVersionNum ...
O-M-G! That works!!! Thank you!!!
I tried making your suggested change as shown below -- but I'm still getting the errors shown below that (sad face)#define NUM_SET_BYTES      10typedef union{ ...
I'm using whatever compiler is in the Arduino IDE version 1.8.13 The errors I'm getting are:Test_01:33:9: error: expected primary-expression before '.' token        ...
I'm afraid I've reached the limit of what I can wrap my brain around with regards to initializing a union -- any help here will be very gratefully received.As you...

Re: One-Hot or Not?

Reply posted 3 years ago (06/09/2021)
You make my little bitmap sound so pedestrian -- in reality I'm working with a 29-segment display -- but I see what you mean :-)

Re: One-Hot or Not?

Reply posted 3 years ago (06/09/2021)
So the answer is "yes" and "no" -- I can live with that :-)

Re: Another Noddy Question

Reply posted 3 years ago (06/08/2021)
I love the way everyone comes up with different solutions to this stuff -- instead of EL, I could use NA (not applicable) or NU (not used). Thanks for the suggestions...

Re: One-Hot or Not?

Reply posted 3 years ago (06/08/2021)
I feared not LOL

Re: One-Hot or Not?

Reply posted 3 years ago (06/08/2021)
The reason I'm confused is when we use "one-hot" in the context of state machines, we can only have one 1 -- but in the multi-segment display example, although we...

Re: Another Noddy Question

Reply posted 3 years ago (06/08/2021)
Thank you for your sage advice :-)

One-Hot or Not?

New thread started 3 years ago
Here's another question that just popped into my mind. Suppose we have a state machine with four states, we could represent these states using two registers and...

Re: Another Noddy Question

Reply posted 3 years ago (06/08/2021)
What about declaring a struct with the number/counter and an array of values -- then declare an array of these structs -- it would use the same amount of memory...

Re: Another Noddy Question

Reply posted 3 years ago (06/08/2021)
That's a great point (not needing the number if we're using -1 to save space) -- thanks for sharing.

Re: Another Noddy Question

Reply posted 3 years ago (06/08/2021)
Thanks Keith -- it's always these little things that niggle me and make me think "I wonder what a professional would do?" :-)

Another Noddy Question

New thread started 3 years ago
Hi there -- sorry as always to bug you, but I have another noddy (beginner) question as follows:Suppose I want to have an array that looks something like the following...

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/31/2021)
Very interesting -- thanks for your feedback -- Max

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
I think MarvinLED for a paranoid android (https://en.wikipedia.org/wiki/Marvin_the_Paranoid_...)

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
"'Marveled' is not the right word..." LOL

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
I love having lots of Flash and RAM ... but I also used to enjoy working within tight resource constraints.

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
I hadn't even thought about a compiler-interpreter twist on things -- thanks for sharing.

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
"In embedded applications however, if there is some knowledge of likelihood, the conditions most likely to occur should be tested first as this will result in...

Re: Questions re Coding Efficiency

Reply posted 3 years ago (03/30/2021)
Hi there -- on the one hand I totally agree -- on the other hand, I'm trying to stay prepared in case I fall through a time-slip and find myself circa 1950 in which...

Questions re Coding Efficiency

New thread started 3 years ago
I just received an email from someone saying that his commercial coding experience started with a programmable calculator with 512 bytes of memory -- he wend on...
It's starting to make sense :-)
"Max, you asked for some cunning tricks to increment."I was hoping I'd be able to understand them LOL
I agree -- my eyes are still watering after reading TCFKAT's code
Ah -- my bad -- but then why doesn't the following work:--Fred++;
Hang on, you can say ++++ ?Does that mean you could say:--Fred++++;But the prefix works different to the postfix -- so if I were to say:Bert = --Fred++++;I'd end...
"The AVR Compiler for ATMEGA chips almost always adds numbers by subtracting their -ve equivalent."Why?
Ooh -- I like the "Fred -= -1;"Re the (Fred >> 1) == (Fred / 2) -- is the "sometimes it won't" tied to the way different compilers treat signed integers --...
Hi there, sorry to bug you again, but I always learn useful stuff here -- again I'm writing a column -- and again I would appreciate the benefit of your feedback.Question...

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/02/2021)
I'd forgotten about that -- thanks for reminding me -- Max

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
I just confirmed this myself -- Max

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
I thought that selecting tap points so as to ensure maximal displacement worked reasonably well

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
Re your question -- my knee-jerk reaction would be 50% -- but I'm guessing you are going to explain the error of my ways :-)Re seeding with a value of 0 doing nothing...

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
I knew the Dilbert one -- I should have guessed xkcd would have something to say -- thanks for the link to random.org

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
This is the first I've heard of this -- very interesting -- thanks for sharing.

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
Do you know of any funny stories involving problems with RNGs and/or the use thereof?

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
"This is one topic where half-measures can be dangerous." I totally agree -- I'm just using them to control pixels wandering around my 12x12 ping pong ball array...

Re: What are the odds? (Random Numbers)

Reply posted 3 years ago (02/01/2021)
Thanks Greg

What are the odds? (Random Numbers)

New thread started 3 years ago
I'm going to be writing a short column on the Arduino's random() function. Remember that I'm a hardware designer by trade, so I'm fighting my way through the software....

Re: Skillsets from 8-bit, 16-bit, 32-bit

Reply posted 3 years ago (12/21/2020)
My knee-jerk reaction is that 8-bit processors typically are more constrained in terms of memory and clock speeds -- also my understanding is that most of them don't...

Re: But Where Should the LEDs Go?

Reply posted 3 years ago (11/30/2020)
Hi Dilberto -- If I had a choice, I'd make all the LEDs tricolor and give the user the ability to select the 0 and 1 colors (to accommodate people with color vision...

But Where Should the LEDs Go?

New thread started 3 years ago
This is a follow-on to my previous post on Karnaugh Map minimizations https://www.embeddedrelated.com/thread/12579/karna...Only if you are interested, I just posted...

Re: Karnaugh Map Minimizations

Reply posted 3 years ago (11/25/2020)
Hi Daniel -- K-Maps really are a useful tool -- re having "9" with LED (d) and "6" with LED (a), it would certainly be possible to do this -- I just used the same...

Re: Karnaugh Map Minimizations

Reply posted 3 years ago (11/24/2020)
Hi Matthew -- I was on the fence about telling them about optimizing using 0s -- but based on your feedback I now think I should add that in as a sidebar, so thanks...

Re: Karnaugh Map Minimizations

Reply posted 3 years ago (11/24/2020)
Hi Dilberto -- it's funny (well, not so funny) how much we forget if we don't keep on practicing with this stuff -- but it's also interesting how quickly it all...

Re: Karnaugh Map Minimizations

Reply posted 3 years ago (11/24/2020)
Hi Kral -- as you say, that's the beauty of K-maps -- the fact that their rows and columns are ordered using as Gray codes -- I'm really impressed that Karnaugh...

Karnaugh Map Minimizations

New thread started 3 years ago
It's funny how easy it is to forget things that you used to do all the time. I'm going to be writing a series of columns teaching digital logic fundamentals to newbies....

Re: Spectacular Sensors Smackdown!

Reply posted 3 years ago (11/06/2020)
The LEDs are daisy-chained -- all controlled from a single pin on the MCU -- there are so many things you could do with this display -- but think what you could...

Re: Spectacular Sensors Smackdown!

Reply posted 3 years ago (11/05/2020)
...

Re: Not Your Grandmother’s Embedded Systems

Reply posted 3 years ago (11/05/2020)
It's not that my mom dwells on the past -- but when she talks about the world she grew up in, it makes me realize how lucky we are today :-)

Not Your Grandmother’s Embedded Systems

New thread started 3 years ago
I was just telling my mom that I have been invited to give the keynote presentation entitled “Not Your Grandmother’s Embedded Systems” at the "Qt Goes Virt:...

Spectacular Sensors Smackdown!

New thread started 3 years ago
Hi everyone -- take a look at this column I just wrote – if you could have an interesting, fun, or frivolous sensor-based project, then you may want to enter it...

Re: Suggestions for the IoT Online Conference

Reply posted 4 years ago (10/15/2020)
I was just thinking about Digilent -- in addition to their Digital Discovery and Analog Discovery 2 tools, they recently entered the embedded measurement world with...

Re: Suggestions for the IoT Online Conference

Reply posted 4 years ago (10/15/2020)
Well, you asked LOL:There's a relatively new FPGA company on the block called Efinix that have some very tasty devices for embedded applications (https://www.digikey.com/en/articles/techzone/2020/...)If...

Re: Suggestions for the IoT Online Conference

Reply posted 4 years ago (10/14/2020)
Hi Stephane, Jim Turley and I have covered some interesting companies on EEJournal recently -- maybe you could get them to talk about their technologies -- I know...

Re: How to Get and Keep a Job

Reply posted 4 years ago (10/09/2020)
We just posted Part 1 of what will be a 3-pard miniseries:How to Get an Engineering Job and Keep It (Part 1) https://www.adiuvoengineering.com/post/how-to-get-......

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/07/2020)
Another really good point -- so remind me, why do people want to be managers LOL

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
This is "Golden" -- thanks so much Aubrey -- Max

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
CLASSIC!!!

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
Hi there -- thanks so much for taking the time to share this feedback.

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
The main thing is that you're having fun LOL

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
Stephane added the missing 'r' back on -- phew!

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
I've not heard this put quite this way -- but there is the Peter Principle -- a concept in management developed by Laurence J. Peter -- which observes that people...

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/05/2020)
Good feedback -- thanks CustomSarge

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/03/2020)
Frig!!!  And for some reason I can only edit the original post, but not the title of the thread -- give me strength!!!  I'll email Stephane at EmbeddedRelated...

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/03/2020)
I love Dilbert cartoons -- I'll add this comment about using them to learn what not to do into my column :-)

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/03/2020)
Ah, Dilbert -- Scott Adams is a genius!

Re: So, You Want to be an Engineering Manager?

Reply posted 4 years ago (10/03/2020)
This is great input Matthew -- I've seen some great managers and some awful ones in my time -- I will let everyone know when these blogs are posted -- Max

So, You Want to be an Engineering Manager?

New thread started 4 years ago
Hi there – this is a follow-on to my previous “How to Get and Keep a Job” question (https://www.embeddedrelated.com/thread/12258/how-to-get-and-keep-a-job)....

Re: Answer Regarding Resistor Tolerances

Reply posted 4 years ago (09/28/2020)
The way the French would tell this, the Hell would be English Food (but they still haven;t forgiven us for Agincourt (https://en.wikipedia.org/wiki/Battle_of_Agincourt...

Re: How to Get and Keep a Job

Reply posted 4 years ago (09/25/2020)
Thanks Dnj -- this is all really good advice -- I'm already planning this as a three-column miniseries in my head.

Re: How to Get and Keep a Job

Reply posted 4 years ago (09/25/2020)
Hi Waydan -- this is fantastic input -- thank you so much for taking the time to share it with me -- Max

Re: Answer Regarding Resistor Tolerances

Reply posted 4 years ago (09/25/2020)
Hi Dilberto -- thanks for your kind words -- they always say that you only discover what you don't know when you try to explain something to someone else. In this...

Re: How to Get and Keep a Job

Reply posted 4 years ago (09/24/2020)
This is great advice Aubrey -- thanks as always -- Max

Re: How to Get and Keep a Job

Reply posted 4 years ago (09/24/2020)
This great info -- thanks Matthew

How to Get and Keep a Job

New thread started 4 years ago
I'm going to be writing a mini-series of blogs aimed at young engineers (or wannabe engineers) about "How to get and keep a job" -- starting with how to decide...

Answer Regarding Resistor Tolerances

New thread started 4 years ago
A couple of days ago I posted a question regarding resistor tolerances (https://www.embeddedrelated.com/thread/12194/quest...)This was part of a series of columns...

Re: Question regarding esistor tolerances

Reply posted 4 years ago (09/21/2020)
I wish one of us knew someone who works in a resistor manufacturing facility today!!!

Re: Question regarding esistor tolerances

Reply posted 4 years ago (09/21/2020)
OMG -- that is another twist!!!   I would never have thought of this one -- Max

Re: Question regarding esistor tolerances

Reply posted 4 years ago (09/21/2020)
"...perhaps dates to vacuum tube days when human labor was cheaper..." I wasn't trying to suggest that the grading was done by hand -- just that the 1% parts were...

Re: Question regarding esistor tolerances

Reply posted 4 years ago (09/21/2020)
One way would be to vary the price -- if you make 1% resistors 100X more expensive, then a lot of designers will decide that 5% is "good enough" LOL
I quite like back-to-back NAND gates myself LOL
Ns Antedeluvian noted in his comment above, I wasn't actually looking for a circuit, but this one is very interesting because it's a twist on one I documented in...
That's a good point about a tiny micro
Thanks Aubrey -- I love your trimpot suggestion -- I fear that since so many people misunderstood my question, it's probably my fault for not articulating it well...
Actually, I did a 9-part mini-series on switch-bounce (see links below) -- I used to be a hardware fan -- then a software supporter -- now I love the debounce chips...

Question regarding esistor tolerances

New thread started 4 years ago
When I was starting out in engineering ~40 years ago, I was told that if a resistor manufacturer was making a bunch of 10K resistors, for example, then their actual...
I need to write a column about using hardware techniques to debounce switches -- if the circuit included an MCU we could do the debounce in software, so I'm looking...

Re: When is a State Machine not a State Machine?

Reply posted 4 years ago (07/21/2020)
"This is just an example of a bigger issue of the fuzzy terminology of our discipline."I'm guessing you aren't a fan of Fuzzy Logic LOL

Re: When is a State Machine not a State Machine?

Reply posted 4 years ago (07/21/2020)
"Of course, you can hold the viewpoint that 'everything is a state machine'."Are you calling my dear old mother a state machine? LOLIn reality, I would say that...

Re: When is a State Machine not a State Machine?

Reply posted 4 years ago (07/21/2020)
"No! The code you are showing is NOT a state machine. In fact, it is an antithesis of a state machine."Don't hold back -- tell me what you really think LOL.While...

When is a State Machine not a State Machine?

New thread started 4 years ago
Suppose we have a loop() function in an Arduino sketch (program) that looks like the following:void loop(){    digitalWrite(PinLed, HIGH);    delay(1000);   ...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/15/2020)
Awesome -- thanks so much for your help -- Max

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/15/2020)
Hi Manoweb -- thanks for your feedback -- On the one hand I'm tempted to go back and change everything to binary strings -- on the other hand, I have memory...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/14/2020)
Thanks so much for taking the time to explain this stuff. Just one more question (for now LOL)Do I have to use both extern and const at the front of the program...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/13/2020)
Hi Kocsonya -- thanks so much for your feedback. Re your points -- I'll take them in reverse order:2. This is a really good point -- as you say, probably not significant...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/13/2020)
I've been thinking (don't laugh; it's true). Would you agree that:-- For software developers creating applications to run on high-level systems like PCs, the keyword...

Re: How Can Hairy Global Variable be Hidden Away?

Reply posted 4 years ago (07/13/2020)
AWESOME!!! I just tried using the "extern" approach and it worked like a charm/ Every day I learn something new -- thank you for your sage advice!!!

How Can Hairy Global Variable be Hidden Away?

New thread started 4 years ago
Hi there, sorry to bug you with yet another stupid coding question (I R a hardware design engineer). This is related to my 12x12 ping pong ball array where each...

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/08/2020)
I just saw this part -- AWESOME -- will the first comparison stay there for awhile? (Can I link to it from a magazine column?)

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/08/2020)
Quick question -- so if I have an 8-bit signed int (int8_t) containing -128 (0x80), I know that if I cast this to a 32-bit signed int (int32_t), it will be sign...

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/08/2020)
Hi Jms_nh -- I am awed by the amount of work you put into this response -- thank you so much for all of this -- it's very much appreciated -- Max

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/07/2020)
Hi Manoweb -- this is very useful feedback -- I've added it to my mental list of "pros" :-)

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/07/2020)
Hi Cprovidenti -- when you say "...it is so self-evidently redundant..." I fear you are looking at this through the eyes of someone who already knows this stuff.I...

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/07/2020)
...

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/07/2020)
Hi Jmdhuse -- I'm with you -- I think it's best to write the code so anyone reading it in the future (and that could easily be me) can understand what it was I was...

Re: Do I need this mask and cast?

Reply posted 4 years ago (07/07/2020)
LOL I'll have to remember that line. But you make a good point -- if the optimizer doesn't perform it's task, my superfluous statements could potentially impact...

Do I need this mask and cast?

New thread started 4 years ago
This is just a quick question -- take a look at the following function:uint8_t GetBlue (uint32_t tmpColor){    return (uint8_t) (tmpColor & 0xFF);}I'm writing...

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
Awesome -- thanks so much for taking the time to explain all of this -- Max

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
Good point, but the way the algorithm works is that the worst case will be to have GetRed() always return values of 255. In this case, we will have an intermediate...

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
I do like using parentheses to explicitly show what I'm trying to do -- and doing so can help a lot with precedence issues.

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
Hi there, this helps a lot -- thanks so much -- Max

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
OK, in the following statement, tmpRed has been declared as a uint32_t. Also, I've modified the GetRed() function to return a uint8_t.tmpRed =   ( (  GetRed(startColor)...

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
...

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
Hi Mike -- do you have a minute to discuss this (256 970 1906)?

Re: To Cast, or Not to Cast

Reply posted 4 years ago (06/26/2020)
Sorry -- I should have said -- it's my pathetic attempt at C.The target processor dev board is a Seeeduino XIAO, which has a 32-bit Arm Cortex-M0+ (and which is...

To Cast, or Not to Cast

New thread started 4 years ago
Hi there -- sorry to bug you with a newbie question, but I'm a hardware design engineer, so software sometimes leaves me a bit confused.Can you take a quick glance...
Oooh, a "Nerds Hamilton" -- I can imagine the queues of nerds stretching down the street and round the corner. I just took a look on Amazon -- this book does look...
"See 'Writing solid code'"  Is that a book (or a stage play)?
Great point -- thanks for sharing -- Max
There's a "long long"? Where will this madness end?(Does every C compiler support the long long data type?)
Awesome info -- thanks Kocsonya
Now I know why I became a hardware engineer rather than a software developer LOL
I pity the person who is tasked with maintaining your code when you retire LOL
I'm good at asking questions -- it's when answering them that I fall down LOL
Hi indigoredster -- thanks for the feedback -- it's a shame (a) these holes were left in the original spec and (b) they haven't been patched over the years -- Ah...
Do you know any examples of compilers that DO NOT shift copies of the sign bit in when performing a >> operation on signed integers?
I see "The quotient is rounded toward zero."  I'm assuming this is because the rounding is basically a truncation operation, but this will make positive numbers...
Hi chaps and chapesses -- sorry to bug you again -- this is a follow-on to my previous question: What size variables are best for 8-bit, 16-bit, and 32-bit MCUs?...
Hi Jmford94 -- I think you offer sage advice -- I'm so glad I posted this question because the various responses have helped shape the way I go forward.
OMG There were THREE typos in each one (there aren't any now) -- for other readers, the way it was when I just went to look was:   for (int8_t i = 0, i < 100,...
This is awesome -- thanks so much for sharing it with me -- Max
Are they "fast" because the compiler stores them in 32-bit words even though they are 8-bit and 16-bit values?
The problem here is that an int is a 16-bit quantity on an Arduino Uno, but a 32-bit quantity on an Arduino Due -- suppose I wrote the program using int on Due and...
Hi there – I have a conundrum rattling around my head. I once read that an MCU is most efficient when its working with its natural word width. On one level...

Re: Block diagram software

Reply posted 4 years ago (04/08/2020)
I've been using Visio for longer than I care to remember (must be more than 20 years) and I love it!!!

Re: Covid-19 Stories

Reply posted 4 years ago (03/25/2020)
Hi Stephane -- Max here -- I'm based in Huntsville, Alabama, USA (I moved here from England for the nightlife -- that's a little Alabama joke right there :-)It's...

Re: Funny or Not Funny?

Reply posted 4 years ago (02/13/2020)
People are dying -- there's no way you can make that funny.There is no way you can make an ad using this topic that won't end up shooting yourself in the foot.Even...
That's something else she says LOL
If clicked, The privacy stuff stuff should pop-up in its own window so it can be dismissed without loosing any other info.
My mother asked me to tell you that you have a tremendous line-up of presenters, and she urges everyone to attend the talk by her first born son LOL

Re: Event Driven Frameworks

Reply posted 4 years ago (01/14/2020)
Have you looked at the leOS multitasking kernel for Arduino by Leonardo Miliani?

Re: Embedded Development Predictions for 2020-2029

Reply posted 4 years ago (01/09/2020)
Good question -- I think one way to look at this is to consider what we expect to be coming our way application and technology-wise, and then "work back" to what...
I passed this question to my chum, Steve Evanczuk (Editor-in-Chief of www.Embedded.com), and he responded as follows:The obvious difference is a JTAG adapter is...

Use this form to contact MaxMaxfield

Before you can contact a member of the *Related Sites:

  • You must be logged in (register here)
  • You must confirm you email address