How do i read the value ? heres the code snippet;
void main(void) {
/* put your own code here */
// int a; //
volatile B_ACQ_VOLTSTR abcd;
volatile word read ;
abcd = _B_ACQ_VOLT ;
}
the sfr ACQ_VOLT has been defined as a union of type word , named ACQ_VOLTSTR like this :
/*** B_ACQ_VOLT - Voltage measurement result; 0x0000026C ***/
typedef union {
word Word;
} B_ACQ_VOLTSTR;
extern volatile B_ACQ_VOLTSTR _B_ACQ_VOLT @(REG_BASE + 0x0000026CUL);
#define B_ACQ_VOLT _B_ACQ_VOLT.Word
Can someone please help? Thank you.
HI Mrunal,,
with your code
volatile B_ACQ_VOLTSTR abcd;
abcd = _B_ACQ_VOLT ;
you should be able to read _B_ACQ_VOLT(at 0x026C) to variable abcd. see attached.
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------