This was dreadful.
var = (int) (c_Array[1] << 8) ; //upper BYTE stored
Type: Posts; User: nutsNguts
This was dreadful.
var = (int) (c_Array[1] << 8) ; //upper BYTE stored
ahh yes.. good call. I completely missed that one.
Thanks
I'm trying to store two different chars to a single Int. Upper B and lower B.
Is this method correct and the most efficient?
//sizeof Int = 2 Bytes
//array of unsigned chars init to hex...
int == 4 for c18
I found the error at that line by debugging, but I believe the error is within funct2. It may be a timing or config. issue.
Thanks very much!
the contents not the address - i should have used a different variable name as int address points to a int which contains an address that is used to store to a physical address in funct2
eg. the...
it should be the high bits(byte) for the first funct2 call, then the low bits(byte) for the second funct2 call.
It's embedded with c18. If you want I could still post a rather large chunk; however I think the rest would be better suited to a microchip forum.
I posted here because it is a simple snippet in...
I'm using a pointer to type int inside a function and trying to shift the contents right 8 and cast to a char, to extract a byte for the upper address.
I get a run-time error.
This seem logical...