<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>8-bit MicrocontrollersのトピックRe: Problem Data table on MCS09SH8</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-Data-table-on-MCS09SH8/m-p/155885#M8891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your code is virtually unreadable because of lack of formatting, and with no comments&amp;nbsp;about the operation of your code.&amp;nbsp; These are mandatory requirements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the issue may be related to the fact that the ADC result is proportional to the Vdd level, whereas I seem to recall that the LM35 provides an output voltage variation in millivolts per degree, independent of the supply voltage.&amp;nbsp;Changing from Vdd of 3.3 volts to 5 volts will result in a lower ADC reading at a given temperature, by a factor of 3.3 / 5 = 0.66.&amp;nbsp; Of course, the Vdd level to the MCU must be accurately regulated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For cases where Vdd is not regulated, it is possible to compensate for the actual Vdd level, by separately measuring the voltage reference within the MCU.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2012 13:54:26 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2012-04-20T13:54:26Z</dc:date>
    <item>
      <title>Problem Data table on MCS09SH8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-Data-table-on-MCS09SH8/m-p/155884#M8890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm woriking with the MCS09SH8, I made a code that reads the value from a lm35 , that digital value its transformed in °C, and the result it will displayed on two &amp;nbsp;7 segment displays.It works perfectly, but only when the microcontroller is connected to the BDM (JM60), the problem comes when i use just a 5V source, the numbers on the displays are messed up, they are not what I previusly defined on the table, I dont know what to do I´ve tried to define the table on the RAM and the same thing happens. Here´s my code, I will appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;INCLUDE 'MC9S08SH8.inc'&lt;BR /&gt;&lt;BR /&gt;RAM EQU $0080&lt;BR /&gt;ROM EQU $E000&lt;BR /&gt;RESET EQU $FFFE&lt;BR /&gt;&lt;BR /&gt;ORG RAM&lt;BR /&gt;ADC DC.B 0&lt;BR /&gt;VOL DC.B 0&lt;BR /&gt;FACT DC.B 2d&lt;BR /&gt;DEC DC.B 0&lt;BR /&gt;UNI DC.B 0&lt;BR /&gt;AUX DC.B 0&lt;BR /&gt;A2 DC.B 0&lt;BR /&gt;&lt;BR /&gt;ORG ROM&lt;BR /&gt;RST MOV #$FF,PTBDD&lt;BR /&gt;MOV #$FF,PTCDD&lt;BR /&gt;CLR PTCD&lt;BR /&gt;LDA #$02&lt;BR /&gt;STA SOPT1&lt;BR /&gt;CLR PTBD&lt;BR /&gt;MOV #$F0,ADCCFG&lt;BR /&gt;CLR ADCSC2&lt;BR /&gt;MOV #$21,ADCSC1&lt;BR /&gt;MOV #$02,APCTL1&lt;BR /&gt;&lt;BR /&gt;LOOP MOV #255,$A0&lt;BR /&gt;MOV #10,$A1&lt;BR /&gt;JSR GETADC&lt;BR /&gt;MAIN LDX DEC&lt;BR /&gt;LDA CODE,X&lt;BR /&gt;STA PTBD&lt;BR /&gt;BSET 1,PTCD&lt;BR /&gt;JSR RETA&lt;BR /&gt;BCLR 1,PTCD&lt;BR /&gt;LDX UNI&lt;BR /&gt;LDA CODE,X&lt;BR /&gt;STA PTBD&lt;BR /&gt;BSET 2,PTCD&lt;BR /&gt;JSR RETA&lt;BR /&gt;BCLR 2,PTCD&lt;BR /&gt;DBNZ $A0,MAIN&lt;BR /&gt;DBNZ $A1,MAIN&lt;BR /&gt;JSR GETADC&lt;BR /&gt;BRA LOOP&lt;BR /&gt;&lt;BR /&gt;GETADC BRCLR 7,ADCSC1,GETADC&lt;BR /&gt;MOV ADCRL,ADC&lt;BR /&gt;LDX FACT&lt;BR /&gt;LDA ADC&lt;BR /&gt;MUL&lt;BR /&gt;PSHX&lt;BR /&gt;PULH&lt;BR /&gt;LDX #10&lt;BR /&gt;DIV&lt;BR /&gt;PSHH&lt;BR /&gt;PULX&lt;BR /&gt;STX UNI&lt;BR /&gt;CLRH&lt;BR /&gt;LDX #10&lt;BR /&gt;DIV&lt;BR /&gt;PSHH&lt;BR /&gt;PULX&lt;BR /&gt;STX DEC&lt;BR /&gt;DIV&lt;BR /&gt;RTS&lt;/P&gt;&lt;P&gt;RETALDA #$EF&lt;BR /&gt;DBNZA *&lt;BR /&gt;RTS&lt;BR /&gt;CODEFCB$3F,$06,$5B,$4F,$66,$6D,$7D,$07,$7F,$67&lt;/P&gt;&lt;P&gt;ORG RESET&lt;BR /&gt;DC.W RST&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 12:04:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-Data-table-on-MCS09SH8/m-p/155884#M8890</guid>
      <dc:creator>Eliud</dc:creator>
      <dc:date>2012-04-20T12:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Data table on MCS09SH8</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-Data-table-on-MCS09SH8/m-p/155885#M8891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your code is virtually unreadable because of lack of formatting, and with no comments&amp;nbsp;about the operation of your code.&amp;nbsp; These are mandatory requirements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that the issue may be related to the fact that the ADC result is proportional to the Vdd level, whereas I seem to recall that the LM35 provides an output voltage variation in millivolts per degree, independent of the supply voltage.&amp;nbsp;Changing from Vdd of 3.3 volts to 5 volts will result in a lower ADC reading at a given temperature, by a factor of 3.3 / 5 = 0.66.&amp;nbsp; Of course, the Vdd level to the MCU must be accurately regulated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For cases where Vdd is not regulated, it is possible to compensate for the actual Vdd level, by separately measuring the voltage reference within the MCU.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 13:54:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-Data-table-on-MCS09SH8/m-p/155885#M8891</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2012-04-20T13:54:26Z</dc:date>
    </item>
  </channel>
</rss>

