> -----Original Message-----
> From: uclinux-dev-boun...@uclinux.org [mailto:uclinux-dev-
> boun...@uclinux.org] On Behalf Of Fabio Giovagnini
> Sent: Thursday, April 01, 2010 12:37 PM
> To: uclinux-dev@uclinux.org
> Subject: [uClinux-dev] Does any of you made an rs485 driver starting
> from uart?
> 
> Hi all,
> I have the following problem:
> I' have connected my SCIF1 port (of sh2a 7203) to  a MAX485, and the
> TXEn/!RxEn to an I/O port.
> I had the idea to write a driver for proc FS to manage the TxEn/!RxEn
> line and
> using the ttySCx driver to send and receive data at 38400.
> But I need to wait the end of the last byte trasmission before to set
> low the
> TxEn/!RxEn line.
> Now I'm doing it with a dilay time; but I was looking for a more
> elegent
> solution
> 
> Any suggestion for me?
> 

I modified the 8250 driver for my board. I noticed that the
serial8250_console_write function simply waits for the transmitter shift
register to be empty before re-enabling the interrupts and unlocking a spin
lock. I added some similar code to the __stop_tx function. This gets called
when a transmitter empty interrupt occurs and there's nothing else to send.
I just wait for the shift register to be empty and then clear the RS485 TXEn
pin. Very ugly but I didn't have a hardware way to do this and I want to
enable the receiver as soon as I can. 

Gary

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to