Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 19th November 2006, 06:12 AM   #1
Default Problem with 89s52 program..

Hi ..

I wrote the following code in Keil for a 89s52 and downloaded it to the chip..

It is only for the bot to move straight..I am using a L298HN ..the code ompiled successfully .. But the bot does not move .. I am getting a voltage reading of 3-4 volts at the Port 2 pins .. PLzz help me out ..
Attached Files
File Type: c forwardtest.c (173 Bytes, 17 views)
jagzviruz is offline  
Old 19th November 2006, 07:56 AM   #2
Default

try this ok
//--------------------------------------------------------------------
#include<AT89x52.h>
int forward=0x33; //assum the code for for movement
int revers=0xD2; //assum the code for rev movement
//-----------------------------------------
void gofor();
void gorev();
void delay();
//-----------------------------------------
void main()
{
while(1){
gofor();
delay();
delay();
delay();
delay();
gorev();
delay();
delay();
delay();
delay();
}
return;
}
//-----------------------------------------
void gofor()
{
P2=forward;
}
//-----------------------------------------
void gorev()
{
P2=revers;
}
//-----------------------------------------
void delay()
{
for(;;
for(;;
}

//-----------------------------------------
manish12 is offline  
Old 20th November 2006, 03:31 PM   #3
Default

The robot go forward with motor I think you should learn how to control motor first.
__________________
Microcontroller Programming Forums:
http://forum.mcuprogramming.com
Answer to your questions!
---

Microcontroller Programming Blog:
http://mcu-programming.blogspot.com
uC - News, Resources and Tutorials
sci-3d is offline  
Old 21st November 2006, 06:57 AM   #4
Default

i could not quite understand sci-3d .. i'll shortly put up the circuit i am using ..
jagzviruz is offline  
Old 23rd November 2006, 04:55 AM   #5
Default Am attaching the l298 ckt that i am using

I have attached the l298 ckt that i am using .. will some one plzz look it up and tell me if it is correct or not
Attached Thumbnails
Problem with 89s52 program..-l298.jpg  
jagzviruz is offline  
Reply

Tags
89s52, problem, program

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
program for writing and testing circuits luca-deltodesco General Electronics Chat 3 13th August 2006 11:17 AM
Newbie, please help with power problem techieguy Micro Controllers 11 25th July 2005 01:07 PM
Program Address for 16F628A johnnyquest Micro Controllers 1 11th January 2005 07:47 PM
Problem with 89S52 rellutzu Micro Controllers 6 24th May 2004 03:23 AM
PicBasic Keypad program Sora Micro Controllers 0 20th April 2004 08:02 PM



All times are GMT. The time now is 01:07 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker