Nope, i have never had to use != before.
Have you considered actually reading a book on C? Obtaining some form of formal programming education? ... reading basically any code in the wild?
I have two books, "Programming in C" which is very long winded and constantly makes reference to examples pages away and has a lot of stuff that is PC related and not really helpful on a µC. I also have "The C pragramming Language" by the language authors themselves, this is so concise that it misses essential bits out expecting me to make assumptions.
So the latter is useless much of the time as it lacks a complete description of the practical implementations and does not even give comprehensive syntax explanation and the former means that by the time I have read the bits I don't have any interest in as not µC related I loose the plot for the bits I may need if i can remember all of the garbage I just read. Using the book as a reference is hard as it's so wordy and diluted nothing can be found with ease.
I could do with a different book i guess that is more embedded orientated. As for formal education I aw doing a pointless HNC in electrical engineering because my boss still remembers the good old days when he went to uni and actually learnt something.
First, “orientated” is not a word. At least not in English. C
Practical C Programming is really pretty good. A lot of the stuff you need with micros is there, such as bit-twiddling and masking, and it’s not specific to any platform. It talks about pointers and how and when to use them. One thing to keep in mind is that you can’t use dynamic memory allocation (
malloc() and
free(), say) on an 8-bit micro. You can and should use pointers when you need to.
For embedded stuff, it always boils down to this. Peripherals live at particular memory locations. Reading from, say, the ADCVAL address returns the most recent conversion results. Writing to the UART_TX register loads the transmitter and starts the hardware shifting out. The rest is really just housekeeping. The micro vendor likely supplies a header file that defines all of the registers that are used to access the peripherals, and that header file should have
#defined bit masks and constants that enable you to make sense of what you are reading and writing.
The rest of what you’re doing, say averaging ADC samples, is the same on a micro as it is on a desktop computer.