Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Why do i get a 0x00 always????

Status
Not open for further replies.

tkvenki

New Member
Hi All,

My project is interfacing a uC to an external UART.

This is how i have connected the necessary devices.
uC --> ST16C2550 ( External UART) --> MAX3232 --> My Computer.

Now in my uC i program to send a data byte say 0x05.
And i will short the TX and RX pins after the MAX3232 i.e. just before the computer.
Then BINGO...I'm able to get the data 0x05(or whatever data that i have sent) in the receive buffer of the ST16C2550(UART chip).

Now i remove the loopback and connect it to my computer. I open a terminal program in my computer(I'm using windmill). Now i should have got the data 0x05 in the terminal program. But i'm getting 0x00 all the time.

I'm using 9600 baud rate. 8data-0parity-1stop-bit.

If i increase the baud rate in my uC. Then i get 0x00's faster.If i decrease the baud rate i'm getting 0x00's slower. But i'm not able to get the expected data...i.e the data i have transmitted.

Has anybody faced this problem??
Any suggestions????

Thanking you,
tkvenki
 
Hi

Check to make sure that the MAX232 is doing the 'voltage conversion' from TTL to RS232 (and vice versa) properly. You can use an oscilloscope for convenience, but this can also be done with a multimeter.

Also check to see if your terminal software expects any handshaking using RTS/CTS? If this is the case, you should turn it off or set it according to the uP's external UART configuration.

Finally, though unlikely to be the case, check that the serial port configuration is set properly in the terminal utility (i.e. port address (COM1..4), IRQ, etc.)
 
Don't even really need a max232. on paper +3 and -3 volts are okay. And on standard hardware usually only +2.5 and 0 volts are needed to trigger a UART's data line state.
 
Hi mdanh2002,

###Check to make sure that the MAX232 is doing the 'voltage conversion' from
TTL to RS232 (and vice versa) properly. You can use an oscilloscope for
convenience, but this can also be done with a multimeter.

>>> In my PC side of the MAX3232 I'm getting +5.5V to -5.5 V. This range is within the RS232 acceptable range( -3V to -12V and +3 to +12 V). Is this OK or do I need to boost up the voltage?
 
>>> Now i remove the loopback and connect it to my computer. I open a terminal program in my computer(I'm using windmill). Now i should have got the data 0x05 in the terminal program. But i'm getting 0x00 all the time.

Are you able to check the PC, when using Windmill, with a known good RS232 input.????

>>> In my PC side of the MAX3232 I'm getting +5.5V to -5.5 V. This range is within the RS232 acceptable range( -3V to -12V and +3 to +12 V). Is this OK or do I need to boost up the voltage?

The voltage levels are OK. Have you checked the serial pins for correct connection, do you have the 0V gnd to pin 5 [on 9way 'D']?
 
Thanks

Thanks all for your replies.......

I was able to solve the problem after a head-banging of 1 week.
The issue seemed to be the load capacitance.

For the 1.8425 crystal, i found that in the application notes and the datasheet it is recommended to use 33PF and 22PF. But some reason we were using 100PF and 47PF as load capacitances.

But in a thread in electro-tech-online, I found out that the culprit may be the crystal's load capacitances. I replaced both my load capacitances by 33PF.

BINGO!!!!!.......It is working perfectly........
 
100pf for a load capacitance?
 
Yes.......One of the load capacitance was 100PF.

Actually the hardware design of the crystal part was taken from one of our working projects. I really do not now how the design is working in that project.!!!!

But i have another question. When we initially used to develop projects on 8051. We used to take 0.1uF as load capacitance ( usually we used 12MHz crystal). We used this 0.1uF as a thumb rule. And it always worked. How is this???

I never expected that choosing a wrong load capacitance will make my crystal malfunction........
 
The crystal doesn't malfunction =) It's the oscillator driver, the crystal is a harmonic but passive device. Modern oscillator drivers probably aren't the same as older oscillator drivers, though I've only really used modern devices so I'm not one to have an authoritative answer on it. PIC or AVR I've only ever heard of load capacitors in the 10-40pF range. Probably just the way modern cmos oscilator circuits are built.
 
tkvenki said:
But i have another question. When we initially used to develop projects on 8051. We used to take 0.1uF as load capacitance ( usually we used 12MHz crystal). We used this 0.1uF as a thumb rule. And it always worked. How is this???

I don't believe it did?, 0.1uF is FAR, FAR too high, there's no way it worked - I suspect you are confused with the decoupling capacitor across the HT rails.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top