serial communication of LPC 2478
Thu Apr 03 2014, 05:24 am
Also this controller's pins are 5V tolarable, thats why i use 5V on this IC only on Vcc pin as you can see in attached schmatic.
After that; is there possibility for level mismatching?diana1234
No, according to the data sheet the logic levels are okay.
What happens if you set P0.21 high (transmit) and don't set it low at all ?
What happens if you change P0.21 as in your program, but don't enable
the receive interrupt. ?
diana1234 like this.
Sat Apr 05 2014, 05:08 pm
Thanks Ajay and ExperimenterUK sir for replying and so sorry for delay in reply back.
@ajay sir
yes i used FIFO mode in my program, but after disabling the FIFO mode by making U2FCR=0; the status is same as previous i.e, it transmits INDI 0xFF.
and the according to datasheet of max485 Vih = 2.0V(min. at RE, DE & DI pins @ Vcc = 5V) and Vil = 0.8V(max. at RE, DE & DI pins @ Vcc = 5V), i think which is OK.
@ ExperimenterUK
1. in this case the data transmit is ok (INDIA) but at this time the serial interrupt is disabled.
2. in this case: the transmission got disturbed (INDI 0xFF)
3. now if the above condition-2 is same and serial interrupt is enabled(U2IER =0x01; U2FCR=0x07; or U2FCR=0x00;), now the result is : it transmits only first 2 characters and stops at all.
@ajay sir
are you using FIFO mode in LPC uart? coz it may be possible that 2 byte deep fifo is causing this issue? after sending last byte you move out of the loop disabling MAX485 tx. Try disabling FIFO mode if its enabled by any chance. I do not feel voltage level is an issue here.. just check Vih and Vil of Max485 from datasheet
yes i used FIFO mode in my program, but after disabling the FIFO mode by making U2FCR=0; the status is same as previous i.e, it transmits INDI 0xFF.
and the according to datasheet of max485 Vih = 2.0V(min. at RE, DE & DI pins @ Vcc = 5V) and Vil = 0.8V(max. at RE, DE & DI pins @ Vcc = 5V), i think which is OK.
@ ExperimenterUK
What happens if you set P0.21 high (transmit) and don't set it low at all ?
1. in this case the data transmit is ok (INDIA) but at this time the serial interrupt is disabled.
What happens if you change P0.21 as in your program, but don't enable the receive interrupt. ?
2. in this case: the transmission got disturbed (INDI 0xFF)
3. now if the above condition-2 is same and serial interrupt is enabled(U2IER =0x01; U2FCR=0x07; or U2FCR=0x00;), now the result is : it transmits only first 2 characters and stops at all.
Mon Apr 07 2014, 10:52 am
ooo.. interrupts?? well in that case it is similar to using fifo. where your sender function will exit before sending all the bytes as you are not waiting there for data to be sent completely. Either you need to keep a provision in interrupt service routine such that only after you have sent all the data P0.21 changes its state. Its only have to do with that pin nothing else is wrong in your program.
If you want to do a minor test.. just enable the pin for transmission and do not disable it afterwards. Your data should come perfectly.
If you want to do a minor test.. just enable the pin for transmission and do not disable it afterwards. Your data should come perfectly.
diana1234 like this.
Mon Apr 07 2014, 05:32 pm
@ Ajay
Thanks sir, the problem is rectified now.
i have done this way
void trans2(char ch2)
{
IOSET0 =0x00200000; // max=1 P0.21
while(!(U2LSR & 0x20));
U2THR=ch2;
while(!(U2LSR & 0x40));
IOCLR0 =0x00200000; //max=0
}
Thank you very much sir
Thanks sir, the problem is rectified now.
i have done this way
void trans2(char ch2)
{
IOSET0 =0x00200000; // max=1 P0.21
while(!(U2LSR & 0x20));
U2THR=ch2;
while(!(U2LSR & 0x40));
IOCLR0 =0x00200000; //max=0
}
Thank you very much sir
Mon Apr 07 2014, 10:09 pm
@ajay sir
yes, now all data is transmitting completely and also data is received ok with full of length....
also i would like to thanks ExperimenterUK....
Thanks alot
yes, now all data is transmitting completely and also data is received ok with full of length....
also i would like to thanks ExperimenterUK....
Thanks alot
[ Edited Mon Apr 07 2014, 10:13 pm ]
Powered by e107 Forum System