free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Go to page  [1] 2
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
UmerAhmed
Tue Nov 11 2008, 12:17PM
 User Offline
Registered Member #12135
Joined: Tue Nov 11 2008, 11:32AM

Posts: 10
Thanked 0 times in 0 posts
Hi all, i'm new to this forum this is my first message, i'm trying to build a project with At89C2051 mc chip. it came with a burnt code that does the job, i just need to modify it to serve my project purpose

i have downloaded keil IDE that compiles for my device. This is a development kit for TR1000 tranceiver module. I do not have the original C code with me all i have is the HEX code. The PIN configuration is this:
Pin6 receive form transceiver
pin7 transmit to transceiver
pin2 receive from outside
pin3 tansmit to outside

originaly this chip is programmed to look for a certain start symbol to know when the message starts, and signal that i'm trying to catch does not have a start symbol in front of it, all i wanna do for starters is to latch the input that is coming from radio means Pin6 to Pin3 which is going to the outside

thanx for ur help

Umer



umer
Back to top


ExperimenterUK
Wed Nov 12 2008, 11:15AM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 207
Thanked 38 times in 37 posts
UmerAhmed wrote ...


module. I do not have the original C code with me all i have is the HEX code. ...

originaly this chip is programmed to look for a certain start symbol to know when the message starts, and signal that i'm trying to catch does not have a start symbol in front of it, all i wanna do for starters is to latch the input that is coming from radio means Pin6 to Pin3 which is going to the outside


If all you wanted to do was to modify the code to not need to see the special start symbol
it might be worth dis-assembling the hex and patching it.
Once you think of doing anything more it's probably better to learn about the At89C2051
and write new code.

Learning all the time
Back to top


UmerAhmed
Fri Nov 14 2008, 04:52AM
 User Offline
Registered Member #12135
Joined: Tue Nov 11 2008, 11:32AM

Posts: 10
Thanked 0 times in 0 posts
thank you for the reply

i'm totally new to this, if anyone help me get started writing code for At89C2051 that is on board with a transceiver and also connected to PC through a serial port. I want to check if i received anything on pin6 blink an LED and then forward this on to Pin3

thanx

Umer

umer
Back to top


UmerAhmed
Fri Nov 14 2008, 04:54AM
 User Offline
Registered Member #12135
Joined: Tue Nov 11 2008, 11:32AM

Posts: 10
Thanked 0 times in 0 posts
here is the schematic for the circuit
img1.pdf

umer
Back to top


pdi33
Fri Nov 14 2008, 08:07AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 774
Thanked 186 times in 181 posts
UmerAhmed wrote ...

thank you for the reply

i'm totally new to this, if anyone help me get started writing code for At89C2051 that is on board with a transceiver and also connected to PC through a serial port. I want to check if i received anything on pin6 blink an LED and then forward this on to Pin3

thanx

Umer


hi umer,
if u want to check the UART communication of the 8051 , then check the tutorial section under the same topic on this site. U will find the basics of writing the code. adding a blinking LED would not be difficult then. write some code, check it on hardware and get back if u have any doubts. u can use the hyperterminal on the PC side for checking transmission /reception of data on the PC.


* inspired to develop,developing to inspire *
Back to top


UmerAhmed
Tue Nov 18 2008, 07:59AM
 User Offline
Registered Member #12135
Joined: Tue Nov 11 2008, 11:32AM

Posts: 10
Thanked 0 times in 0 posts
Thank you for your response
i wrote this code for my At89c2051 but its not working if i can get some helpful pointers
that will be great


/*-----------------------------------------------------------------------------
Definitions for P1 (8 bits), P1.0, and P1.1.
-----------------------------------------------------------------------------*/
sfr P3 = 0xB0; /* SFR for P3 */

sbit P3_1 = P3^1; /* SFR for P3.1 */
sbit P3_2 = P3^2; /* SFR for P3.2 */
sbit P3_4 = P3^4; /* SFR for P3.4 */
sbit P3_5 = P3^5; /* SFR for P3.5 */
sbit P3_7 = P3^7; /* SFR for P3.7 */

/*-----------------------------------------------------------------------------
MAIN C function
-----------------------------------------------------------------------------*/
void main (void)
{
P3_2 = 1;
P3_4 = 1;
P3_5 = 1;
P3_7 = 1;

/*-----------------------------------------------
This loop reads P3.2 and writes the value read
to P3.1.
-----------------------------------------------*/
while (1)
{
P3_1 = P3_2; /* Copy P1.0 to P1.1 */
P3_4 ^= 0x01;
P3_5 ^= 0x01;
P3_7 ^= 0x01;
}
}

/*-----------------------------------------------------------------------------
-----------------------------------------------------------------------------*/

all i'm trying to do is to make the three LEDs connected to Pins 8,9 and 11 of the microcontroller to blink on each iteration of the loop also if i get anything on pin 6 of the MC i wanna copy that to pin 3

thank you




umer
Back to top


sashijoseph
Tue Nov 18 2008, 08:54AM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 651
Thanked 141 times in 134 posts
Try inserting some delay at the end of the while loop,else the led's will blink too fast to notice.

Let there be music........
Back to top


UmerAhmed
Sun Nov 23 2008, 08:51PM
 User Offline
Registered Member #12135
Joined: Tue Nov 11 2008, 11:32AM

Posts: 10
Thanked 0 times in 0 posts
thanks for all the help !
i'm using keil IDE for development and having a little problem that i need help with
when i try to build target for At89C2051 for the following program
////////////////////////////////////
#include<AT892051.h>

#define ON 0
#define OFF 1
/*-----------------------------------------------------------------------------
MAIN C function
-----------------------------------------------------------------------------*/



//void delay (int);

void main (void)
{
//unsigned int ON_OFF = 0;
P3_2 = ON;
P3_4 = ON;
P3_5 = ON;
P3_7 = ON;
//P3 = 0xFF;


/*-----------------------------------------------
This loop reads P3.2 and writes the value read
to P3.1.
-----------------------------------------------*/
// delay(20000);
while (1)
{

P3_1 = P3_2; /* Copy P1.0 to P1.1 */
/* P3_4 = ON_OFF;
P3_5 = ON_OFF;
P3_7 = ON_OFF;
ON_OFF = ~ON_OFF; */
// delay(33000);
}
}
/*
void delay(int millisec)
{
int x=0;
int y=0;
for( x=0;x<millisec;x++)
{
//do nothing
/* for(;y<100;y++)
{
//do nothing
} */
/*
}
}
*/
///////////////////////////////////
if i generate output without selecting the - Use On-Chip ROM option from menu
Project->Options for Target Target1 -> Target tab
compile fails saying
//////////
Build target 'Target 1'
linking...
*** ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: CODE
SEGMENT: ?PR?MAIN?MAIN
LENGTH: 000EH
*** ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: CODE
SEGMENT: ?PR?MAIN?MAIN
LENGTH: 000EH
*** ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: CODE
SEGMENT: ?C_C51STARTUP
LENGTH: 000CH
*** ERROR L107: ADDRESS SPACE OVERFLOW
SPACE: CODE
SEGMENT: ?C_C51STARTUP
LENGTH: 000CH
*** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT
SEGMENT: ?C_C51STARTUP
MODULE: STARTUP.obj (?C_STARTUP)
*** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL
SYMBOL: ?C_START
MODULE: STARTUP.obj (?C_STARTUP)
ADDRESS: 000AH
*** ERROR L105: PUBLIC REFERS TO IGNORED SEGMENT
SYMBOL: MAIN
SEGMENT: ?PR?MAIN?MAIN
*** ERROR L120: CONTENT BELONGS TO ERRONEOUS SEGMENT
SEGMENT: ?PR?MAIN?MAIN
MODULE: .\main.obj (MAIN)
Program Size: data=9.0 xdata=0 code=29
Target not created
///////////
if i create a hex file without selecting the above mentioned option it generates a .hex file
but that is referencing code outside of the address space of the ROM, so when i burn that on the chip
it fails there programmer software says: 99 bytes in error.

have you ever seen a problem like this before

any help is greatly appreciated

thanx

Umer

umer
Back to top


shyam
Sun Nov 23 2008, 10:11PM

 User Offline

Registered Member #2984
Joined: Mon Aug 06 2007, 11:33AM

Posts: 725
Thanked 108 times in 104 posts
are u using the startup.s file ?
try compiling again after removing it from project.

lProgress is not made by early risers or hard workers, but by LAZY people, trying to find easier ways to do the same........
Back to top


UmerAhmed
Mon Nov 24 2008, 08:23AM
 User Offline
Registered Member #12135
Joined: Tue Nov 11 2008, 11:32AM

Posts: 10
Thanked 0 times in 0 posts
tried after removing it same result
nothing changed,
selecting on-chip does not generate an output
unselecting it produces an output which is not suitable for this processors memory module

thanx for ur help


umer
Back to top


Go to page  [1] 2  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems