I am working with MM912J637 ibs. But I am not able to read the value that is the result of voltage conversion.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I am working with MM912J637 ibs. But I am not able to read the value that is the result of voltage conversion.

452 Views
mrunaljoshi
Contributor II

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.

Labels (1)
0 Kudos
1 Reply

363 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos