hi i am final year student of electrical engineering and doing a project on 8051 microcontroller. in this project,i have to interface the 8051 to maltab for real world data.i successfully complete the interfacing and communicate serially on proteus.data which is transfer from 8051 to matlab is not accurate when i send more than one character.in single character, matlab does not show any data.plz help me,how to solve that problem as i am using 8051 first time.
... have a MAX232(equivalent) inbetween.
try sending 'U' (capital U) constanly and have a look with a scope, you should see a squae wave of 4800 Hz.
I am using AT89C51 (no data appeared in hyperterminal) and also AT89C52 (garbage data appeared), with xtal
what is your reset? how do you program the chips?
Erik
Yes, I have a MAX232. I programmed the chips using Intelligent Universal Programmer kit and LabTool software. I will try your suggestion. Didn't get your question, 'what is your reset?'?
Didn't get your question, 'what is your reset?'?
do you have a silly RC reset or a decent reset chip?
#include <reg51.h> void main(void) { PCON=0xFF; //to set PCON.7 for baud rate TMOD=0x20; //timer 1 mode 2 TH1=0xFA; //for baud rate 9600 SCON=0x50; TR1=1; //start timer 1 while (1) { SBUF='U'; //sends U while(!TI); TI=0; } }
I have used a ready to solder microcontroller 'kit'. It doesn't have a chip specifically dedicated to resetting (such as MAX1232?), it's just an RC reset.
It doesn't have a chip specifically dedicated to resetting (such as MAX1232?), it's just an RC reset. too bad
what does your scope show when you run the scoping code I show above?
at the TXD pin, at the RS232 line
will get back to you as soon as i get to try this out.
Aniket
Didn't get a chance to reprogram my chip with the scoping code yet, but I tried out the same thing with my present code and got unexpected results- 50kHz square wave..can't understand what the problem could be.
tell nothing
tried the scoping code today...got the same result..square wave with 50kHz frequency.
square wave with 50kHz frequency
I can't see a reason for 50kHz, but easily see 50Hz.
is it really kilo Hz?
yes it was definitely 50kHz.
Verified again today; actually it wasn't a complete square wave, just 230mV dropping down from 5V with a frequency of 50kHz to 52kHz. Could something be wrong with the port?
if you are not working with a PCB state so if you are: do you have a ceramic cpacitor from Vdd to gnd with less than 1cm traces to the chip are the traces to the xtal and burden caps less than 1cm
One of the pins of the xtal along with a burden cap pin, which are connected to pin 18 of 8051 have a physical distance of exactly 1cm from pin 18 - hence the length of the PCB track joining them must be very slightly greater than 1cm. The other pin going to pin 19 has a distance of almost 1.5cm. Apart from the burden caps there's only one other ceramic cap (rest all being electrolytic) present in the power supply unit, one end connected to gnd and the other to pin 40 for Vdd, dist between that pin and pin 40 is almost 1.5cm.
one other ceramic cap (rest all being electrolytic) present in the power supply unit, one end connected to gnd and the other to pin 40 for Vdd, dist between that pin and pin 40 is almost 1.5cm "a wire/trace is not a wire"
PLEASE do not use pin numbers, I GUESS "pin 40" is Vdd. (I have not used DIL for ages) how long is the trace from the other end of the cap to the gnd pin "gnd is not gnd"
rest all being electrolytic does that mean aluminum or tantalum?
just to check, solder a ceramic 10-100nF directly to the gnd and Vcc pins on the uC
What does a scope set to AC 1V show on the Vdd AT THE uC?