1 Reply Latest reply on Oct 18, 2009 9:10 PM by graa

    Problem with Libraries Designer 5

    user_37207811
              Hi   
         
      I'm starting with PSOC'S but I have a problem trying to use the DAC, it seems that the Designer doesn't find the DAC9.h file, I'm using the example from the datasheet just to test it out and i get this error when I try to build the project:   
         
      lib/psocconfig.asm   
      lib/psocconfigtbl.asm   
      ./boot.asm   
      ./main.c   
      !E C:\Users\Twister\DOCUME~1\PSOCDE~1.0PR\DIGITA~1\DIGITA~1\main.c(2): cannot include source file "DAC9.h"; file not found   
         
      C:\PROGRA~1\Cypress\Common\CYPRES~3\tools\make: *** [obj/main.o] Error 1   
         
      DigitalToAnalog - 2 error(s) 0 warning(s) 23:19:36   
         
      This is the Code I'm using   
         
      #include "m8c.h"   
      #include "DAC9.h"   
      #if DAC9_OFFSETBINARY   
      const INT iMAXVAL=510; // top of ramp   
      const INT iMINVAL=0; // bottom of ramp   
      #else   
      #if DAC9_TWOSCOMPLEMENT   
      const INT iMAXVAL=255; // top of ramp   
      const INT iMINVAL=-255; // bottom of ramp   
      #else   
      // DAC9_SIGNANDMAGNITUDE   
      #endif   
      #endif   
      void main(void)   
      {   
      INT iVal; // RAM for loop iteration variable   
         
      DAC9_Start(DAC9_FULLPOWER); // power up the DAC   
      if(DAC9_OFFSETBINARY)   
      {   
      while(1)   
      {   
      for(iVal=iMINVAL; iVal <= iMAXVAL; iVal++)   
      DAC9_WriteStall(iVal); // update DAC   
      }   
      }   
      else if(DAC9_TWOSCOMPLEMENT)   
      {   
      while(1)   
      {   
      for(iVal=iMINVAL; iVal <= iMAXVAL; iVal++)   
      {   
      DAC9_WriteStall(iVal); // update DAC   
      }   
      }   
      }   
      else   
      {   
      DAC9_Stop(); // power off DAC   
      }   
      }   
         
         
         
         
      I also tried to copy the DAC9.h file to the library directory in my projects folder but I just get more errors.   
         
         
      Could anybody help me?   
         
      Thank You!   
        • 1. Re: Problem with Libraries Designer 5
          graa
                  Check what is the name of the user module in the project. If you had not renamed it, the default name would be DAC9_1. So, the header file would be DAC9_1.h and all the function names will also have the same DAC9_1 prefix. In the device editor, rename the user module to DAC9 and the errors should go away.