Regarding S12ZVM128.

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

Regarding S12ZVM128.

742 Views
pratibhasurabhi
Contributor V

I am using MTRCKTSBNZVM128 evaluation board.I want to trigger the ADC by software using trigger mode without configuring the PMF,TIM and PTU. Could you please suggest me how to do this?

Labels (1)
3 Replies

424 Views
RadekS
NXP Employee
NXP Employee

Hi Preatibha,

You may use voltage measurement example as your inspiration:

https://community.nxp.com/docs/DOC-332475

The trigger is managed by command:

ADC0FLWCTL_TRIG = 1;          //Trigger for next new conversion

 

The ACC_CFG bits in ADC0CTL_0 register should be configured either for Single Access Mode - Data Bus or Dual Access Mode.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

424 Views
pratibhasurabhi
Contributor V

Thanks for the quick reply.If you could explain the #define INTFLG_SEL(x) and INT_FLG(x) left shifting in adc_lba.h file,it will be great.

0 Kudos

423 Views
RadekS
NXP Employee
NXP Employee

Hi Pratibha,

Every ADC command is configured by 4-byte configuration (ADCCMD_0 ~ ADCCMD_3).

Since these commands are loaded into ADC automatically by DMA, they must be aligned to 4-byte boundary.

The definitions in adc_lba.h file just offers user-friendly way how to configure these commands.

For example:

#define INTFLG_SEL(x)  ((unsigned long)((x)&0x0F)<<24) //Conversion Interrupt Flag Select 1..15, 0 means conversion without interrupt flag

It just take lowest 4 bits from x value and move it 24 times to left into ADCCMD_0_ INTFLG_SEL[3:0] position.

The INTFLG_SEL[3:0] configure selected interrupt flag by simple binary combination value.

So, if we use INTFLG_SEL(5), the ADCCMD_0_INTFLG_SEL[3:0] will be configured as 0b0101 and ADC will set appropriate interrupt flag (in this case CON_IF[15:1]= 0x0010) when this command finish.

The ADCCONIF_CON_IF[15:1] display which flag was set. A single flag bit in CON_IF[15:1] refers to single INTFLG_SEL[3:0] bit combination.

The INTFLG_SEL(0) configuration will not set any of CON_IF[15:1] flags when command finish. When ADC command is configured as End Of Sequence/End Of List/End Of List and wait... command the ADCCONIF_EOL_IF flag may signalize end of the measurement sequence.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos