Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/10/05 23:52
Read: times


 
#84703 - Philips sample code/Keil problems
I have just received some sample code from Philips for the 87LPC762. It consists of two C files and an assembler file. Now the problem is getting the code assembled and compiled...

I started with the assembler file. The first error was caused by this line:
$include (c:cc51include8051regp87lpc762.inc)

That file was of course not included. I tried removing it to see what was missing, and I solved that problem by inserting this code (taken from the Keil .h file):
IP0     DATA    0B8H
IP0H    DATA    0B7H
P1M2    DATA    92H

The next problem was line two:
$CASE

That causes this error: *** ERROR #68 IN 2 (MODUL.ASM, LINE 2): UNKNOWN CONTROL OR BAD ARGUMENT(S)

Removing that line causes the error to go away, but what does $CASE do?

And now the C problems. The two files include line like this one:
interrupt(1) using(1) void T0_Interrupt(void)

I changed those lines to this format that I normally use:
void T0_Interrupt(void) interrupt 1 using 1

and that seems to help...

One of the files also includes this declaration:
rom char key_tbl[][] = {
                         { K04, K03, K02, K01 },    // row 0
                         { K08, K07, K06, K05 },    // row 1
                         { K12, K11, K10, K09 },    // row 2
                         { K16, K15, K14, K13 },    // row 3
                       };

I had to change the first line to
code char key_tbl[16][4] = {

to make that work.

A strange line in the main file was this:
_rom unsigned char UCFG1 _at (0xFD00) = 0x7B;
/* 6 clock - internal 6 MHz brownout = 2,5V */

That looks like something for the programmer?

The final "problem" was this function:
static bit using(1) TestRow(void)

According to C51: "*** ERROR 262 IN LINE 75 OF KEYPAD3.C: 'using/disable': can't return bit value", so I changed bit to unsigned char. Since the return value is just checked for true false (if (TestRow()) etc.) I don't think that will cause problems.

Then I finally got the files to compile and assemble without errors and warnings...

But how do I link the stuff? I tried a commandline like used in the Keil samples:
l51 main2.obj,keypad2.obj,modulat.obj to test

But I get 9 warnings that way. Like these two:
*** WARNING 1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  RC5_INIT
    MODULE:  MAIN2.OBJ (MAIN2)

*** WARNING 2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  RC5_INIT
    MODULE:  MAIN2.OBJ (MAIN2)
    ADDRESS: 00B8H

Any suggestions?

Does anyboady know what compiler/assembler Philips uses? The code does not appear to be C51 5.1 compatible at least ;)

Best regards,

Mikkel C. Simonsen


List of 32 messages in thread
TopicAuthorDate
Philips sample code/Keil problems            01/01/70 00:00      
   Why don't you ask Philips?            01/01/70 00:00      
      Re: Why don't you ask Philips?            01/01/70 00:00      
         Re: Ask Philips?            01/01/70 00:00      
            Re: Ask Philips?            01/01/70 00:00      
               Link            01/01/70 00:00      
                  Re: useful App Note            01/01/70 00:00      
                     87 89            01/01/70 00:00      
                        Re: 87 89            01/01/70 00:00      
               Tasking.            01/01/70 00:00      
                  Re: Tasking            01/01/70 00:00      
                     Keil?            01/01/70 00:00      
                        Re: Keil            01/01/70 00:00      
                           Linking            01/01/70 00:00      
                              Linked!            01/01/70 00:00      
                                 Re: Linked            01/01/70 00:00      
                                    Linking            01/01/70 00:00      
                  Re: Tasking            01/01/70 00:00      
         reply            01/01/70 00:00      
   Dunfields or Tasking?            01/01/70 00:00      
      Tasking            01/01/70 00:00      
   2D Array problem            01/01/70 00:00      
      Compiler can deduce size.            01/01/70 00:00      
         can, but doesn't have to!            01/01/70 00:00      
            Fully Bracketed Initializers            01/01/70 00:00      
               Ask Keil            01/01/70 00:00      
               C99 vs. C90            01/01/70 00:00      
         Compiler deducing array size            01/01/70 00:00      
            Tasking Compiler deduces array size!            01/01/70 00:00      
               Which Array?            01/01/70 00:00      
                  That Array!            01/01/70 00:00      
                     One More Test            01/01/70 00:00      

Back to Subject List