<?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>topic Re: I need help!  L1822 linker error in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/I-need-help-L1822-linker-error/m-p/254047#M6538</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are missing implementation of functions HILO1_init,&amp;nbsp; TERMIO_Init and TERMIO_PutChar in your project.&lt;/P&gt;&lt;P&gt;In order to add implementation of TERMIO_Init and TERMIO_PutChar to your application you need to add the file&lt;/P&gt;&lt;P&gt;{Install}\lib\hc12c\src\termio.c to your project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know where the function HILO_init is coming from. You may have to add a library or another source file to your project. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Feb 2013 06:46:40 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2013-02-11T06:46:40Z</dc:date>
    <item>
      <title>I need help!  L1822 linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/I-need-help-L1822-linker-error/m-p/254046#M6537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="3203_3203.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/119089iD965B7C1325E7FF9/image-size/large?v=v2&amp;amp;px=999" role="button" title="3203_3203.jpg" alt="3203_3203.jpg" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="wk5_link error.jpg"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/38413i73F76F7023A97B66/image-size/large?v=v2&amp;amp;px=999" role="button" title="wk5_link error.jpg" alt="wk5_link error.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error I'm getting. I'm using CodeWarrior IDE version5.9.0, build 5294.&amp;nbsp;&amp;nbsp; I'm in an online class and this is for a lab to control a dc motor through PWM in a closed loop using an optical interrupter switch.&amp;nbsp; I told my instructor I was having a problem and he sent me this code which is complete and should work, but now I'm having a linking error and he's ignoring my e-mails.&amp;nbsp; I'm kind of a noob at CodeWarrior, but I think this should be an easy fix I think I just need to point these functions to the correct files(?).&amp;nbsp; I just have no idea how to do it.&amp;nbsp;&amp;nbsp; Thanks!&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;------------------------------------------------&lt;/P&gt;&lt;P&gt;// encoder_period.c&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Display motor period measured by HC12 Timer to Hyperterminal&lt;/P&gt;&lt;P&gt;// Wytec HC12 Dev Board (24MHz eclk) using Codewarrior-&lt;/P&gt;&lt;P&gt;// Input: Port T pin 0 (PT0) - connects to Opto-interrupter output&lt;/P&gt;&lt;P&gt;// Open J24 to disconnect PT0 from 7-segment display&lt;/P&gt;&lt;P&gt;// Additional connections and ports as in motor_test.c above&lt;/P&gt;&lt;P&gt;// This program will not download to flash or start with the motor connected&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;hidef.h&amp;gt;/* common defines and macros */&lt;/P&gt;&lt;P&gt;#include &amp;lt;mc9s12dg256.h&amp;gt;/* derivative information */&lt;/P&gt;&lt;P&gt;#pragma LINK_INFO DERIVATIVE "mc9s12dg256b"&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "TERMIO.h"&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//RAM variables&lt;/P&gt;&lt;P&gt;int rawvalue=0;// unreduced timer period count&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void init_PLL();&lt;/P&gt;&lt;P&gt;void init_timer();&lt;/P&gt;&lt;P&gt;unsigned int get_period();&lt;/P&gt;&lt;P&gt;void motor_1speed(char);&lt;/P&gt;&lt;P&gt;void delay(int);&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/************main************/&lt;/P&gt;&lt;P&gt;void main(){&lt;/P&gt;&lt;P&gt;init_PLL();// added - initialize PLL for 24 MHz CPU clock&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EnableInterrupts;&lt;/P&gt;&lt;P&gt;HILO1_init();&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TERMIO_Init();&lt;/P&gt;&lt;P&gt;SCI0BDL=156;// added to slow down baudrate to 9600 for hardware&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;init_timer();// configures input capture timer ch.0:...&lt;/P&gt;&lt;P&gt;// ... set main timer period = 5.33us&lt;/P&gt;&lt;P&gt;motor_1speed(133);//run motor at duty cycle passed into fcn as parameter&lt;/P&gt;&lt;P&gt;puts("started");//wait until this is displayed, then connect motor lead&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for(;;){&lt;/P&gt;&lt;P&gt;rawvalue=get_period();//returns timer period count between 2 pulses &lt;/P&gt;&lt;P&gt;printf("period counts = %d\n\r",rawvalue);// send rawvalue to monitor&lt;/P&gt;&lt;P&gt;printf("RPM = %d\n\r",(rawvalue/80)*60);&lt;/P&gt;&lt;P&gt;delay(1000);//wait 1 sec. for rawvalue to be sent to monitor &lt;/P&gt;&lt;P&gt;}/* keep on */&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void init_timer(){//configures input capture timer: main timer period = 5.33us&lt;/P&gt;&lt;P&gt;TSCR1=0x90;&lt;/P&gt;&lt;P&gt;TSCR2=0x06;&lt;/P&gt;&lt;P&gt;TIOS&amp;amp;=~0x01;&lt;/P&gt;&lt;P&gt;TCTL4=0x01;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;unsigned int get_period(){//measures period between 2 timer ch. 0 input pulses&lt;/P&gt;&lt;P&gt;int event1;&lt;/P&gt;&lt;P&gt;int period;&lt;/P&gt;&lt;P&gt;TFLG1|=0x01;&lt;/P&gt;&lt;P&gt;while(!(TFLG1&amp;amp;0x01)){}&lt;/P&gt;&lt;P&gt;event1=TC0;&lt;/P&gt;&lt;P&gt;while(!(TFLG1&amp;amp;0x01)){}&lt;/P&gt;&lt;P&gt;period=TC0+event1;&lt;/P&gt;&lt;P&gt;return period;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void motor_1speed(char speed){&amp;nbsp; //init Port B; run motor at single speed (dutycounts)&lt;/P&gt;&lt;P&gt;DDRB|=0x03;&lt;/P&gt;&lt;P&gt;PORTB=0x01;&lt;/P&gt;&lt;P&gt;PWMCLK=0x01;&lt;/P&gt;&lt;P&gt;PWMSCLA=0x03;&lt;/P&gt;&lt;P&gt;PWMPOL=0x01;&lt;/P&gt;&lt;P&gt;PWMPER0=200;&lt;/P&gt;&lt;P&gt;PWMDTY0=speed;&lt;/P&gt;&lt;P&gt;PWME|=0x01;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void init_PLL(){// initializes phase-locked loop (hardware)for 24Mhz CPU clock&lt;/P&gt;&lt;P&gt;asm(sei);// for running board standalone w/out Codewarrior&lt;/P&gt;&lt;P&gt;CLKSEL&amp;amp;=~0x80;&lt;/P&gt;&lt;P&gt;PLLCTL|=0x40;&lt;/P&gt;&lt;P&gt;SYNR=0x05;&lt;/P&gt;&lt;P&gt;REFDV=0x01;&lt;/P&gt;&lt;P&gt;while((CRGFLG&amp;amp;0x08)==0){// wait here for lock&lt;/P&gt;&lt;P&gt;CRGFLG|=0x08;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;CLKSEL|=0x80;&lt;/P&gt;&lt;P&gt;asm(cli);&lt;/P&gt;&lt;P&gt;}&amp;nbsp;&amp;nbsp; // use this function as is&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void delay(int del){// delay for 'del' msecs&lt;/P&gt;&lt;P&gt;int i,j;&lt;/P&gt;&lt;P&gt;for(i=0;i&amp;lt;del;i++)&lt;/P&gt;&lt;P&gt;for(j=0;j&amp;lt;2000;j++);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/******* end of file **********/&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Feb 2013 04:01:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/I-need-help-L1822-linker-error/m-p/254046#M6537</guid>
      <dc:creator>nathanso</dc:creator>
      <dc:date>2013-02-10T04:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: I need help!  L1822 linker error</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/I-need-help-L1822-linker-error/m-p/254047#M6538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are missing implementation of functions HILO1_init,&amp;nbsp; TERMIO_Init and TERMIO_PutChar in your project.&lt;/P&gt;&lt;P&gt;In order to add implementation of TERMIO_Init and TERMIO_PutChar to your application you need to add the file&lt;/P&gt;&lt;P&gt;{Install}\lib\hc12c\src\termio.c to your project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not know where the function HILO_init is coming from. You may have to add a library or another source file to your project. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 06:46:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/I-need-help-L1822-linker-error/m-p/254047#M6538</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2013-02-11T06:46:40Z</dc:date>
    </item>
  </channel>
</rss>

