I'm trying to use the NXP I2C/SPI-to-UART device in a project and have enabled the ttySC0 driver by modifying config.txt:
dtoverlay=sc16is750-i2c,int_pin=24,addr=48
a few questions:
1) How do you change the baud rate from the default of 9600? For standard serial ports I use the "termios" struct.
2) config.txt seems to suggest it's possible to change the i2c address from 0x48, but it appears the slave address is always 0x48 no matter what value I change it to.
3) Is there any sample C code available showing how to use this driver? Searching the forum I've only found some python code.
Re: /dev/ttySC0 driver for sc16is750
So answering my own question, since the driver is similar to a standard serial port driver I used the termios struct and the cfsetospeed() call to change the baud rate.
Any idea how to tell how many bytes are in the rx buffer? I tried the ioctl FIONREAD but the "&bytes" argument is always 0.
Any idea how to tell how many bytes are in the rx buffer? I tried the ioctl FIONREAD but the "&bytes" argument is always 0.
Re: /dev/ttySC0 driver for sc16is750
again answering my own question, it helps if you connect the IRQ pin to pin 24 of the Raspberry PI
. Once I did that FIONREAD works as expected.

Re: /dev/ttySC0 driver for sc16is750
One more question hopefully answered from someone other than myself
. In I2C mode wouldn't you need to set the SCL clock rate to 400KHz if you want to support serial reads of 115K on the NXP device?

Re: /dev/ttySC0 driver for sc16is750
I'm just a wealth of information
. After changing the Pi SCL clock rate to 400KHz in config.txt, the NXP device supports incoming serial data at 115.2K.

Re: /dev/ttySC0 driver for sc16is750
Hi,
I am just trying to interface sc16is750 using breakout board from sparkfun. But it seems its not really working. I was able to get the driver up and running but I2C bus seems to recognize the module and there is some activity on data line when I send data but nothing comes out of TX line of board.
Any help is appreciated.
I am just trying to interface sc16is750 using breakout board from sparkfun. But it seems its not really working. I was able to get the driver up and running but I2C bus seems to recognize the module and there is some activity on data line when I send data but nothing comes out of TX line of board.
Any help is appreciated.
Re: /dev/ttySC0 driver for sc16is750
I have the SC16IS750 board and I did manage to enable the driver.
I am able to send some data through minicom to another instance of minicom that is connected to uart pins of RPi. But I can't receive any data through the SC board.
I connected the interrupt pin to gpio 24 and marked that in the config.txt file.
How can I debug the problem?
I also have two boards and both behave in same manner so I doubt it's HW problem.
I am able to send some data through minicom to another instance of minicom that is connected to uart pins of RPi. But I can't receive any data through the SC board.
I connected the interrupt pin to gpio 24 and marked that in the config.txt file.
How can I debug the problem?
I also have two boards and both behave in same manner so I doubt it's HW problem.
Re: /dev/ttySC0 driver for sc16is750
So I'll answer my own question.
SC16IS750 IRQ pin has to have pull-up resistor to 3.3V line. If you omit that it will not work as overlay driver depends on the interrupt.
So minimum connection is as follows:
I don't know if fixed-clock parameter is actually needed but as this configuration works I left it there.
SC16IS750 IRQ pin has to have pull-up resistor to 3.3V line. If you omit that it will not work as overlay driver depends on the interrupt.
So minimum connection is as follows:
- IRQ (pull-up to 3.3V via 100k resistor [can be any value between 10k~100k]) to dedicated GPIO pin (GPIO24) in my case
- Vcc (3.3v) and Gnd
- SDA and SCL to respective gpio pins on RPi
- A0 and A1 to GND (this can be tied to other configuration to change address)
- I2C/SPI to 3.3V for I2C operation
- Reset to 3.3V to be sure
Code: Select all
dtoverlay=sc16is750-i2c,addr=0x4D,int_pin=24,fixed-clock=14745600
-
- Posts: 1
- Joined: Fri Oct 25, 2019 5:23 am
Re: /dev/ttySC0 driver for sc16is750
Hi,
I am trying to use this i2c to uart convertor for my project. Can you tell me from where you got the driver code. Any help is appreciated.
Thanks
I am trying to use this i2c to uart convertor for my project. Can you tell me from where you got the driver code. Any help is appreciated.
Thanks
-
- Posts: 20
- Joined: Sat Sep 28, 2013 11:40 am
Re: /dev/ttySC0 driver for sc16is750
I should probably post this in another thread, but I have modified the driver for the sc12xx series UART so you can use CMPAR for 9 bit comms. I have it tested and working on a current project.
If there is enough interested, I will seek out some help from the more experienced about adding this change into the official channels. I have never used git or never developed on open source before so its a bit of a learning curve. Talk about a baptism of fire!
I will eventually contribute this change anyway, provided someone does not beat me to it.
If there is enough interested, I will seek out some help from the more experienced about adding this change into the official channels. I have never used git or never developed on open source before so its a bit of a learning curve. Talk about a baptism of fire!
I will eventually contribute this change anyway, provided someone does not beat me to it.