go_away

Author Topic: Logic Levels problem  (Read 1094 times)

0 Members and 1 Guest are viewing this topic.

Offline anonymoussomeoneTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Logic Levels problem
« on: April 14, 2010, 10:40:45 AM »
Hey everyone, I spent the last few days making a piece of code to work on the microcontroller and now am done with it.
This is what I have achieved till now:

1) I can wirelessly transfer data from one computer to another using simple OOK Tx and Rx, to which I had to shift because o the unavailability of the 3.6 Volts regulator IC TM55 3601. Though it came along with some noise, but the data was intact and received as it should be.
2) Assuming that the first data bit might be lost in transmission, I have decided the following protocol after reading a post on it on Net;
Databyte 1: Synchro byte (* in my case)
Databyte 2: Synchro byte(*)
Databyte 3: Address of Device(for example 1)
Databyte 4: Command byte(to turn pin x ON on Port B, if data matches)
Databyte 5: Checksum byte = Databyte+Address(1+A=r)

I coded the microcontroller using this logic and was able to successfully receive the data and turn on the ports
If synchro byte 1 gets corrupted, code ignores it and watches for the second synchrobit, which should be uncorrupted as per the assumption. If whole data is corrupted, checksum fails and nothing happens, data is discarded.

Now I am trying to send data from computer to Microcontroller through Wireless Rx and Tx.
But the microcontroller works on a different logic level.

Transfering data from computer to another computer involved use of MAX232 in between which accepted data above .8V as input. So it could detect my data. The voltage across data terminals of Rx is around 1.5 - 2 Volts, which is not enough to be detected as positive logic by the microcontroller. So it receives nothing. Tried using BC548 to amplify the signal using 4.7K resistors, but then the ever persistent noise also gets amplified and data is never received as it should be.
So what could be the possible solution for this?


Receiver(rough)


Tranmitter(rough)

Offline tim_wang

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Logic Levels problem
« Reply #1 on: April 14, 2010, 03:33:40 PM »
The MAX232 receiver has minimum VOH = 3.5V, and maximum VOL = 0.4V. That means the receiver output voltage should be either above 3.5V for a logic 1, or below 0.4V for a logic 0. If you are seeing between 1.5 to 2V, then either your MAX232 is not wired correctly or it was damaged. If you think neither case is true, you can try running the output signal through a buffer like 74LS241.

Offline anonymoussomeoneTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Logic Levels problem
« Reply #2 on: April 16, 2010, 09:30:21 PM »
the wiring seems to be correct, coz I have remade it many times. And if it were to be wrong then why would another computer receive the data? The data is contained along with noise, but is received as I noticed from the brays terminal.

O1 + H**1Ar,

such type of data is received without using any antenna wire. Here, **1Ar is my information byte. The null bytes of serial port before and after transmission are not detected here.
And when I use an antenna then this type of response is received:

<00>PำD<00><00><00>༳f<00><00>
my data is nowhere to be found, even between start and stop bits, garbage values are there.

Offline tim_wang

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Logic Levels problem
« Reply #3 on: April 17, 2010, 11:11:55 AM »
Are you saying the computer can send and receive data from the microcontroller using wired transmission, but not using wireless?

Offline anonymoussomeoneTopic starter

  • Jr. Member
  • **
  • Posts: 11
  • Helpful? 0
Re: Logic Levels problem
« Reply #4 on: April 22, 2010, 01:20:04 PM »
Are you saying the computer can send and receive data from the microcontroller using wired transmission, but not using wireless?
yes, this is what I am saying.
I can communicate with microcontroller using wired transmission, but not wirelessly.

Using the same wireless setup to communicate between two computers, I am able to send data.

Offline tim_wang

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: Logic Levels problem
« Reply #5 on: April 22, 2010, 06:21:03 PM »
If you are able to reliable send and receive data wirelessly between 2 computers using the exact same setup, then noise is probably not an issue. If you want, you can run the signal through a low pass filter before amplifying it with the BC548.

To ensure the signal going to your ATmega16's RXD pin is either 5V or 0V, you need to make sure the BC548 operates only in either cutoff or saturation mode. In cutoff mode, the collector voltage will be pulled up to 5V by the pullup resister. In saturation more, the collector voltage will be pulled down to 0.25V - 0.60V (from datasheet). Make sure your pullup resistor is large enough to ensure this. Check with a volt meter.

Optionally, you can also run the collector voltage through a buffer like the 74LS241 before sending it to your ATmega16's RXD pin.

By the way, the V+ pin on the MAX232 should be going to 5V, not ground.
« Last Edit: April 22, 2010, 06:23:54 PM by tim_wang »

 


Get Your Ad Here