hm_fa_da
Full Member level 5
Hi,
I am trying to communicate to ATM90E26 by atXmega32A4U through PS2501 optocoupler:
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 ).
I am trying to communicate to ATM90E26 by atXmega32A4U through PS2501 optocoupler:
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 ).