This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

lcd



hi,

I have written the  below code in IAR Workbench.But it doesnt work.The error is 

Fatal Error[Pe1696]: cannot open source file "io310.h" D:\IAR\lcd\main.c 


#include "io430.h"

/* This example demonstrates how to display digits on the
LCD 4 MUX method */
/* enable use of extended keywords */
#pragma language=extended
/* include sfrb/sfrw definitions for I/O registers */
#include "io310.h"
char digit[10] = {
0xB7, /* "0" LCD segments a+b+c+d+e+f */
0x12, /* "1" */
0x8F, /* "2" */
0x1F, /* "3" */
0x3A, /* "4" */
0x3D, /* "5" */
0xBD, /* "6" */
0x13, /* "7" */
0xBF, /* "8" */
0x3F /* "9" */
};
void main(void)
{
int i;
/* Initialize LCD driver (4Mux mode) */
LCDCTL = 0xFF;
/* display "6543210" */
for (i=0; i<7; ++i)
LCDMEM[i] = digit[i];
}

Can you please suggest the solution for the error

  • Compiler error says that it can't find file in project directory where main.c is.

    Try to use:

    #include <io430.h>

  • IO430.h was deprecated long ago and is perhaps no longer supported now. IAR has aligned its header files with the TI/MSPGCC name of MSP430.h

    However, IO430.h contained bitfield definitions for hardware registers which are no longer provided. Mainly because they are, as convenient as they are for the coder, incompatible with compiler code optimization and lead to inefficient code.

    Of course, Ilmars is also right with its comment. Standard includes should be included with brackets instead of quotes. However, most compilers search both, project and system include paths for both, just in diferent order (so in case of two files of the same name in each, using brackets or quotes gives one of them precedence.)

**Attention** This is a public forum