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.

UART Auto baud problem between Xmega and ATm90E26 through optocoupler

Status
Not open for further replies.

hm_fa_da

Full Member level 5
Joined
Sep 16, 2003
Messages
287
Helped
10
Reputation
20
Reaction score
4
Trophy points
1,298
Activity points
3,217
Hi,

I am trying to communicate to ATM90E26 by atXmega32A4U through PS2501 optocoupler:

m26.png

i am sending some bytes to m90e26 which if it gets them, will reply 3 bytes always. in this step i just check reply be an LED ( should be lighted ).

according to m90e26 datasheet:

"UART baud rate is determined by the host, and it can be auto-detected by the M90E26. The baud rates supported are 2400 and 9600. The first byte (FEH) is used in detecting the baud-rate. The baud-rate of a transaction shall be kept unchanged.
For a new transaction, host may change the baud rate. However, it is suggested that boad rate remain the same in application."

now the problem is that if i set the Xmega baudrate on 9600 ( osc=2MHz, Bscale = -7, Bsel=1539 which makes 0.02% Error only ), the M90E26 doesn't reply to requests.
i check the output of optocoupler through a PC serial monitor ( URX pin of schematic ), i see the orders truely but m90e26 doesn't reply.

when i decrease the pullup RP2 resistor in schematic from 22K ohm to 1K ohm, it works sometimes ! when i decrease the resistor down to 500 ohm, then it works fine ! and m90e26 replies all requests !

but 500 ohm pull up resistor is strange ! what's the problem ?
is it because m90e26 is so much sensitive to baudrate errors ?!!
but i only have less than 1% error in baud rate ...

can it be because of optocoupler low speed ?! when i directly connect xmega pin to M90e26, it works fine !

note: it works fine with 2400bps baud rate with 2.4K pull up resistor ( didn't check with other values yet ).
 

Hi,

how does the M90E26 detect the baud rate:
* rising edge to falling edge, or
* rising edge to rising edge?

Klaus
 

It's not mentioned in datasheet !

It only says when first byte, (FEh) is sent to m90e26, it selects 2400 or 9600 bps.

i think the problem is because of PS2501 optocoupler low speed, it has about 5us switching off delay at 100ohm load !
That seems to be the reason when i use higher pull up ( =optocoupler load ) resistor, the delay increases so destroys waveform ...
 

That seems to be the reason when i use higher pull up ( =optocoupler load ) resistor, the delay increases so destroys waveform ...
Quite obviously that's the problem according to your results. It may be the case that the M90E26 auto baud logic isn't designed as robust as it could be and has been tested only with zero pulse width distortion. But unfortunately you have to take it as is.

I also think that 500 ohm isn't an unusual load for a slow optocoupler. If you can't afford the current, switch to 2400 baud or use a faster optocoupler.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top