AnsweredAssumed Answered

Is it safe to use LDW with ADC_DR?

Question asked by stevenb on Feb 25, 2018
Latest reply on Feb 27, 2018 by Philipp Krause

Although the STM8 reference manual RM0031 does not seem to mention it, I understand from the AN2658 (section 2.7) that I must read ADC_DRH and ADC_DRL in a specific order, with the actual order depending on my configuration of the ADC.

It seems obvious (at least to me) that the the LDW instruction can be use to read these two consecutive locations is one instruction. AN2658 does not mention this 'obvious' method, so I'm I missing something in my understanding. Is LDW unsafe in this siltation?

 

Specifically I was intent is to do either:

   LDW x, $0x5344

or

  LDW y, $0x5344

 

adcLDW

atomic

16-bit adc  adc stm8

Outcomes