<?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>S12 / MagniV MicrocontrollersのトピックProblems with Processor Expert and MCS912DG256</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133316#M1853</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Firstly I am a new user to Codewarrior and PE.&amp;nbsp; I do however know C.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am part of a team that is attempting to communicate with 3 devices and output with PWM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The communication is performed on two SPI interfaces (an accelerometer and a yaw sensor) and also the AN00 ADC device available on chip.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problems are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; The yaw and accelerometers require 16 bits of data to be sent and recieved with the SS pin low.&amp;nbsp; When using sendChar its only low (obviously) for the first 8 bits.&amp;nbsp; When I use sendChar twice the SS is high momentarily before returning to low.&amp;nbsp; Since I do not have interrupts enabled I cannot use the SendBlock() function and even if I were, it appears that the data still will not&amp;nbsp; be clocked correctly.&amp;nbsp; Can someone advise me either with a code segment or a setting that can be changed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The ATD is NOT working.&amp;nbsp; Its very simple really, I am using the ATD on pin AN00 and I am applying a signal to the correct pin (and my grounds are tied together).&amp;nbsp; In fact, I have an eval board that uses the MC9S12DT256 and it still does not communicate even when checking the pins listed on the user guide.&amp;nbsp; The problem is when stepping through&amp;nbsp; with the debugger, the measurement is attempted but the atd_stat? register is never cleared/set whatever when its waiting for the measurement.&amp;nbsp; This is the same with interrupts disabled.&amp;nbsp; This really should not be hard to do.&amp;nbsp; Can anyone advise me to proper settings perhaps?&amp;nbsp;&amp;nbsp; I think that there is something wrong with PE because Im getting identical results on my board and the eval board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has brought my project to a halt and I'm at the final week :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks much in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 May 2007 10:03:39 GMT</pubDate>
    <dc:creator>PhattieM</dc:creator>
    <dc:date>2007-05-10T10:03:39Z</dc:date>
    <item>
      <title>Problems with Processor Expert and MCS912DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133316#M1853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Firstly I am a new user to Codewarrior and PE.&amp;nbsp; I do however know C.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am part of a team that is attempting to communicate with 3 devices and output with PWM.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The communication is performed on two SPI interfaces (an accelerometer and a yaw sensor) and also the AN00 ADC device available on chip.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problems are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; The yaw and accelerometers require 16 bits of data to be sent and recieved with the SS pin low.&amp;nbsp; When using sendChar its only low (obviously) for the first 8 bits.&amp;nbsp; When I use sendChar twice the SS is high momentarily before returning to low.&amp;nbsp; Since I do not have interrupts enabled I cannot use the SendBlock() function and even if I were, it appears that the data still will not&amp;nbsp; be clocked correctly.&amp;nbsp; Can someone advise me either with a code segment or a setting that can be changed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The ATD is NOT working.&amp;nbsp; Its very simple really, I am using the ATD on pin AN00 and I am applying a signal to the correct pin (and my grounds are tied together).&amp;nbsp; In fact, I have an eval board that uses the MC9S12DT256 and it still does not communicate even when checking the pins listed on the user guide.&amp;nbsp; The problem is when stepping through&amp;nbsp; with the debugger, the measurement is attempted but the atd_stat? register is never cleared/set whatever when its waiting for the measurement.&amp;nbsp; This is the same with interrupts disabled.&amp;nbsp; This really should not be hard to do.&amp;nbsp; Can anyone advise me to proper settings perhaps?&amp;nbsp;&amp;nbsp; I think that there is something wrong with PE because Im getting identical results on my board and the eval board.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This has brought my project to a halt and I'm at the final week :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks much in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2007 10:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133316#M1853</guid>
      <dc:creator>PhattieM</dc:creator>
      <dc:date>2007-05-10T10:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Processor Expert and MCS912DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133317#M1854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Mark,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;To answer your first problem regarding the external SPI devices, you will need to allocate a GP output&amp;nbsp;for SS use (rather than automatically generated SS signal), and control this to suit the peripherals.&amp;nbsp; You will also need to match the CPHA and CPOL settings to suit each peripheral device.&amp;nbsp; In all probability, you would &lt;U&gt;not&lt;/U&gt; use PE for the SPI interface code so as to gain more flexibility, and simplify the resulting code.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Do a search of these forums, and you should find many examples of SPI master&amp;nbsp;usage to communicate with various external devices.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;I cannot help with your ATD problem.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2007 11:05:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133317#M1854</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-05-10T11:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with Processor Expert and MCS912DG256</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133318#M1855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for the replies but nothing appears to be working.&amp;nbsp; I've removed the SPI bean and replaced it with the SPI Init bean (to offer more control). Here's the initialization code: (generated by PE).&amp;nbsp; This will show you the settings.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;//Init code generated by PEvoid Accelerometer_Init(void){/* Control register 2 setting */  /* SPI1CR2: MODFEN=1 */  setReg8(SPI1CR2, 16);                 /* Frequency setting */  setReg8(SPI1BR, 0);                   /* Control register 1 setting */  /* SPI1CR1: MSTR=1,SSOE=1 */  setReg8(SPI1CR1, 18);                 }//bigmac's send code//************************************************//*//*  This method sends a character across the SPI//*  interface. It returns the last read value.//*//************************************************Byte1 Accelerometer_SendChar(Byte1 data){    while (!SPI1SR_SPTEF); /* Wait for Tx buffer empty */  SPI1DR = data;  while (!SPI1SR_SPIF);  /* Wait for Rx buffer full */  return SPI1DR;}//My register init code//************************************************//*//*  This method uses the SPI interface to //*  initialize the Left and Right Accelerometers.//*//************************************************void Set_ControlRegisters_Accel(void){    //Word data structure  Byte1 send_data1, send_data2;    //Top 4 Bytes: Writing to Address for CTRL_Reg_1;  //Bot 4 Bytes: Data to set the CTRL_Reg_1.  send_data1 = 0x60;  send_data2 = 0xC4;    SPI1CR1_SSOE = 0;    //Send the data across the SPI interface.  (void)Accelerometer_SendChar(send_data1);  (void)Accelerometer_SendChar(send_data2);    SPI1CR1_SSOE = 1;    //Top 4 Bytes: Writing to Address for CTRL_Reg_2;  //Bot 4 Bytes: Data to set the CTRL_Reg_2.  send_data1 = 0x61;  send_data2 = 0x80;    SPI1CR1_SSOE = 0;      //Send the data across the SPI interface.  (void)Accelerometer_SendChar(send_data1);  (void)Accelerometer_SendChar(send_data2);    SPI1CR1_SSOE = 1;     //Control Register 3 only deals with highpass filter  }&lt;/PRE&gt;I'm also including links to the datasheets for both the yaw and accelerometers.&amp;nbsp; TIA for your help.&lt;BR /&gt;&lt;A href="http://www.digchip.com/datasheets/new_parts/200602/1088928.php" rel="nofollow noopener noreferrer" target="_blank"&gt;Accelerometer&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.analog.com/UploadedFiles/Data_Sheets/ADIS16100.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;Yaw&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;~Mark&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by PhattieM on &lt;SPAN class="date_text"&gt;2007-05-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:55 PM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by PhattieM on &lt;SPAN class="date_text"&gt;2007-05-10&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;06:55 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 00:37:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Problems-with-Processor-Expert-and-MCS912DG256/m-p/133318#M1855</guid>
      <dc:creator>PhattieM</dc:creator>
      <dc:date>2007-05-11T00:37:04Z</dc:date>
    </item>
  </channel>
</rss>

