Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Multiple devices at a single serial port of 89C51 (8051)

Status
Not open for further replies.

AMACreative

Junior Member level 1
Joined
Aug 4, 2011
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,434
Hi there!

I'm making my final project on an autonomous UAV (Unmanned Aerial Vehicle) and I'm trying to make my circuit a bit less complicated.

I know that I can use a multiplexer when sending from 8051 TX (haven't tested it yet) but I need to know if I can use the same technique on the 8051 RX (receiving)?

I want to use GPS to send data strings (continuous) & Computer serial port for giving commands (occasionally) on a single serial port of 8051.

Please tell me how to solve this problem without getting my receiving data mixed up!

Thnx a ton...!!! ;)
 

yes you can do that.. use CD4052, this is an analog multiplexer..

you can select which input/output you want to receive without mixing the data.
 
If you don’t want to lose data you need to create additional serial port ..
One already exists, so us it with the serial port interrupt ..

The second port has to be created in software, and as port pins you can use EXT-INT0 or EXT-INT1 as RX pin and any general purpose I/O as TX pin (if required) ..

SEARCH or Google for [8051 and SOFTWARE UART] ..

:wink:
IanP
 
If you don’t want to lose data you need to create additional serial port ..
One already exists, so us it with the serial port interrupt ..

The second port has to be created in software, and as port pins you can use EXT-INT0 or EXT-INT1 as RX pin and any general purpose I/O as TX pin (if required) ..

As IanP mentioned loss of serial data is an issue with a multiplexed serial port.

Another possible option to use with a multiplexed serial port, is to implement hardware flow control if you serial devices support it.

The PC serial port will almost always support hardware flow control, the GPS is another issue.

You could implement hardware flow control for the PC and when you switch back to the GPS you may have to flush the serial data until you receive a complete GPS sentence header.

Some additional information on softUARTs:

Silabs AN115 - SOFTWARE UART EXAMPLES

BigDog
 
check this.. there is a software uart implementation .. the software uart is written using asm and the implementation is in C language..

**broken link removed**
 
follow circuit

uart.JPG
 
I've checked the whole system for Software UART and found that it is a small project in itself and I have already 5.7K of code to handle. Also I don't have a space port and all timer interrupts are already in use.

So the MUX idea would be better if just a little more eleborated!!!

Thnx a lot guys!!! :)
 

Ather option is to "change horses" ..
Try the DS89C450, fully compatibile with 8052, ..
**broken link removed**
one of its features is 2 x uarts ..

:wink:
IanP
IanP
 
Is the burning technique of 8051 and DS89Cxx is same?

Because I have already bought a burner of 89C51 standalone and my project cannot afford more than $25 for it.

And also can anybody refer me a trainer book for DS series like M. Ali Mazidi for 805???

Thnxxx... a lot!!!
 
Last edited:

Because I have already bought a burner of 89C51 standalone and my project cannot afford more than $25 for it.
You don't need a "special" burner, just connection with a pc via the serial port ..
Then, run the software from the MAXIM website ..

And also can anybody refer me a trainer book for DS series like M. Ali Mazidi for 805???
The PDF file (from MAXIM) on the DS89C430/450 contains info on all additional features of the DS-microcontorller, specially have a look at the description of the SFRs, the rest is "almost" identical to 8051 ..

:wink:
IanP
 
I fully agree with IanP that the MAXIM/DALLAS DS89C430/450 would be the best pin compatible replacement for the 89C51.

However, I thought it might be worth mentioning that the 89C51, like the majority of 8051s, executes one instruction cycle for every 12 clock cycles, while the DS89C430/450 executes one instruction cycle for every one clock cycle.

You should notice a very significant performance increase with the DS89C430/450, the downside is any execution dependent delays used in your code will most certainly have to be recalculated and recoded.

BigDog
 
Alright!!! Here's the thing!!!

I tried searching DS89C430/450 all over Pakistan but nobody ever orders for this IC so there is no chance I'm gonna get it here because I'm short on time.

I heard something about CD4066 Buffer Switch from an friend but I couldn't get the schematics from him.

Please tell me if CD4066 is the right choice and how to interface it with 8051.

P.S. I'm using 89C55 now.

Thnx a lot... Luv ya guys!!!
 

@AMACreative

So have you picked up a DS89C430/450? If so, have you had any trouble programming it? As IanP mentioned it is actually quite straight forward.

Here's a guide to help you when using Keil to program the DS89C430/450 Series:



You can also use the MTK with the DS89C430/450 Series:

Microcontroller Tool Kit (MTK) is a PC-based application in the programming and debugging of microcontrollers manufactured by Maxim. This software requires Windows® 95 or more recent operating system, and an open COM port. It allows an embedded system designer to program and configure Maxim microcontrollers equipped with a ROM/bootstrap loader.

**broken link removed**

Let me know if you have any problems, I've used the DS89C430/450 Series in my commercial projects.

Also, for future reference checkout Silicon Labs line of the 8051 Series, they extensive peripherals, including multiple UARTs, up to 100 MIPS performance and are my personal preference for 8051 based projects. Their customer and technical support are excellent and their MCU use an inexpensive USB programmer/debugger which has a Keil compatible plugin module.

Silicon Labs Mixed-Signal, 8-bit Microcontrollers (MCUs)

Unfortunately, none of their MCUs are available in a DIP package, so they were not a viable option for this situation.

BigDog
 
Hey Big Dog thanks a ton man but as I told that I didn't find the DS89C430 in Pakistan. So I had to switch back to 89C55 (Because of 16KB ROM).

Most of the websites does not ship to Pakistan and the one who does take shipping twice the rate of MCUs.

I've checked the website (Silicon Labs) you mentioned but in this region they only ship to India but not Pakistan.

Now I need to connect 89C55 (89C51 code compatible) with CD4066 buffer but I do not know the schematics. :(
 

...I want to use GPS to send data strings (continuous) & Computer serial port for giving commands (occasionally) on a single serial port of 8051...

At my sight - due to above specifications - it is possible to demultiplex 2 RX´s into a sigle one.
Could be done just managing data lost, at the higher layer communication protocol, including echo answer, pack indexer and data integrity checker ( as CRC ).

Obviously, that´s not an elegant software solution, but meets to purchasing constraints to acquire other hardware components.


+++
 
@AMACreative, I apologize I didn't see your recent posting. You must of posted it, while I was typing in my lengthy reply.

Do you have access to NXP (Philips) 8051s, they have several versions with two UARTs? I've seen their MCUs utilized in several projects from individuals in your country.

Otherwise, it looks like you may have to multiplex the to serial devices. Or implement Andre's suggestion of demultiplexing just the RX's lines.

Implement either scheme should be fairly straight forward, however I'll see if I can find you an example schematic.

BigDog
 
Alright! Now I am using 89C55 micro-controller (as I told in last post), I'm using CD4066 14-pin buffer switch to connect 2 devices to 89C55s RX pin.

Buffer switch allows me to switch the object but I also needed an interrupt to switch from GPS (continuous) device to PC (occasional) device.

Now I tried to switch by the help of an external interrupt 0 (pin3.2) using the idea that bits from PC will create an interrupt on it but the only stupid problem is that external interrupt is activated on low level trigger while the data bits from PC will be high level bits.

I tried using a not gate 74S04 but it's not working.

HELP!!! PLEASE!!!! :'(
 

Thnx a lot everybody!

I succeeded in using multiple devices with the help of a CD4066 Buffer switch.

It's quite simple than I thought.

I would've never be able to done that without ur help! Thnx a ton! :)

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top