Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 05, 2016, 05:19:42 05:19


Login with username, password and session length


Pages: [1]
Print
Author Topic: Help Needed For AT89C2051  (Read 1727 times)
0 Members and 1 Guest are viewing this topic.
sureshsharma2032
Junior Member
**
Offline Offline

Posts: 83

Thank You
-Given: 3
-Receive: 11


« on: July 01, 2010, 12:35:50 12:35 »

Hi to all, I am a beginner in microcontrollers & c compiler programs. By a guided book of " Microcontoller Projects in C for 8051" . I am building my first project but I am having errors. I have attached all the files. I have compiled it in Keil uvision 3. Pls can anyone help me out to get the program working.

Any help would be really appreciated.

I am having this error in Keil :

Build target 'Target 1'
compiling LED Binary Counter.c...
LED BINARY COUNTER.C(1): warning C500: LICENSE ERROR (R208: RENEW LICENSE ID CODE (LIC))
LED BINARY COUNTER.C(29): warning C206: 'wait_a_sec': missing function-prototype
linking...
*** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS
    SEGMENT: ?PR?WAIT_A_SECOND?LED_BINARY_COUNTER
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  WAIT_A_SEC
    MODULE:  LED Binary Counter.obj (LED_BINARY_COUNTER)
*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  WAIT_A_SEC
    MODULE:  LED Binary Counter.obj (LED_BINARY_COUNTER)
    ADDRESS: 082EH
Program Size: data=11.0 xdata=0 code=87
creating hex file from "LED Binary Counter"...
"LED Binary Counter" - 0 Error(s), 5 Warning(s).
Logged
zuisti
Senior Member
****
Offline Offline

Posts: 371

Thank You
-Given: 219
-Receive: 567


« Reply #1 on: July 01, 2010, 01:10:52 13:10 »

Hi;
I don't working with Keil compilers, but as I see:

You have a function declared at begin:

/* Function to delay about a second */
void wait_a_second()
{
  unsigned int x;
  for(x=0;x<33000;x++);
}

and you try using this:
   wait_a_sec();              /*Wait about a second*/ 

This name-missing will be your problem I think.
Try it!

Cheers
zuisti
Logged
chinninitin
Active Member
***
 Muted
Offline Offline

Posts: 136

Thank You
-Given: 145
-Receive: 37



« Reply #2 on: July 05, 2010, 11:07:53 11:07 »

Hi,

It seems that there are two problems

1)  License problem that you have to reslove ;-)

2) Code: here is corrected code, you just made mistake in calling and declaring function name  ...sec() and ...second()

#include <AT892051.h>

/* Function to delay about a second */
void wait_a_sec()
{
  unsigned int x;
  for(x=0;x<33000;x++);
}

/* Start of main program */
main()
{
  int LED=1;                   /*initialize count to 1*/

  for( ; ; )                      /*Start of endless loop*/
  {
    P1=~LED;                   /*Invert and output*/
   LED++;                     /*Increment the count*/
   wait_a_sec();              /*Wait about a second*/
  }
}


Regards
Chinni
Logged
rentau
Junior Member
**
 Muted
Offline Offline

Posts: 44

Thank You
-Given: 10
-Receive: 15


« Reply #3 on: July 06, 2010, 03:41:23 03:41 »

about evaluation, your using 2051, soo you shouldn't have any problem, as with 2k limit, re-install your kiel.
Logged

everything has its beginning ,not all has its end~
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC