Electronics > Microcontrollers

Combining ADC Result Over 2 Registers Into 1 Variable

<< < (5/5)


--- Quote from: ziq8tsi on June 04, 2011, 05:21:22 am ---
--- End quote ---

Okay.  First we need to insert your two missing semicolons and complete the declaration of the member "bytes" so that the code will compile.

Hi-tech C lite produces twelve instructions for your code (plus six for the extra assignment) compared to fifteen for the shift and or.


Oh Jesus, nail me to the wall, this was written straight into the forum's text editor.
Do you code 100% correct every time without the compiler reminding you of your errors?
I spend most of my life coding in C++ these days so probably got the syntax of the struct wrong, I'm sorry you had to work it out a bit

The extra assignment was purely used as an example of what to do beyond the ADC reading operations and is irrelevant, the actual loading of the ADC is the part that matters, so 12 over 15 cycles is still better, what's your point?

The endianess of a compiler will be known, just as you need to read the PIC's data sheet to know how to read the ADC.
We are NOT talking about portable code here, it is very much platform dependent.

you should gave him the "pseudo-code" Ray.

I actually got this working a while ago...I'm trying to figure out the LCD driver right now.


[0] Message Index

[*] Previous page

There was an error while thanking
Go to full version