Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Question on HV_Solar_DC_DC Kit DPL-ISR.asm

$
0
0

Hi,

I have recently bought a HV_Solar_DC_DC Kit which uses Piccolo F28035 card. I'm playing with it before buying the DC-AC kit. I have a quastion about the DPL-ISR assembly file. I would highly appreciate if someone could kindly explain me the methodology used to introduce an offset to an ADC result in this assembly file. Please have a look at the following code, (you will find this in lines 196 to 210 in HV_Solar_DC_DC Kit software's DPL-ISR)

My Question is

1. If the PU value (niormalized value) of the offset is 0.026, why has TI used 0.02x4095 to calculate the value to be offset? (Kindly guide me if I'm mistaken)

Please let me know if the question is not clear

Many Thanks

Pas

;----------------------------------------------------

;Subtract IL CS amplifier offset and calculate IL

MOVW DP, #_AdcResult ; load Data Page to read ADC results

MOV ACC, @_AdcResult.ADCRESULT1<<12 ; ACC = IL_raw

SUB ACC, #82<<12 ; ACC = IL_raw - offset, IL CS OPAMP offset = 0.026*3.3V = 85.8mV, ; Therefore, 12bit offset value = 0.02*4095 = 82

MOVB XAR2, #0

MAXL ACC, @XAR2 ; set min value to zero, ; Save IL

.ref _IL

MOVW DP, #_IL

MOVL @_IL, ACC

;.endif

;----------------------------------------------------------

 

 


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>