Giter VIP home page Giter VIP logo

sc16is752's Introduction

SC16IS752

SC16IS752 Driver for ATmega328/ESP8266
SC16IS750/752 Driver for RaspberryPi

SC16IS752-2

SC16IS752-1


for i2c

SC16IS750/752 ATmega328/ESP8266 RPi
VCC -- 5V(*1) 5V(*1)
GND -- GND GND
RESET -- N/C N/C
A0/CS -- 5V(*2) 5V(*2)
A1/SI -- 5V(*2) 5V(*2)
NC/SO -- N/C N/C
IRQ -- N/C N/C
I2C/SPI -- 5V 5V
SCL/SCLK -- SCL(*3) SCL(*4)
SDA/VSS -- SDA(*3) SDA(*4)

(*1) The SC16IS750 breakout board is equipped with a MIC5219 LG33 voltage regulator, which provides 3.3V to the chip.
The SC16IS752 breakout board is equipped with a AMS1117-3.3 voltage regulator, which provides 3.3V to the chip.
Therefore, the level of i2c is 3.3V, but all pins are 5V tolerant.
It can be used with either 3.3V MPU or 5V MPU.

(*2)i2c address selection

A0 A1 Address
5V 5V 0x48
5V GND 0x49
GND 5V 0x4C
GND GND 0x4D

(*3)Requires PullUp
How to change scl/sda.
#13

(*4)No Requires PullUp


for SPI

SC16IS750/752 ATmega328/ESP8266/Rpi
VCC -- 5V(*1)
GND -- GND
RESET -- N/C
A0/CS -- CS
A1/SI -- MOSI
NC/SO -- MISO
IRQ -- N/C
I2C/SPI -- GND
SCL/SCLK -- SCK
SDA/VSS -- GND

(*1) The SC16IS750 breakout board is equipped with a MIC5219 LG33 voltage regulator, which provides 3.3V to the chip.
The SC16IS752 breakout board is equipped with a AMS1117-3.3 voltage regulator, which provides 3.3V to the chip.
Therefore, the level of SPI is 3.3V, but all pins are 5V tolerant.
It can be used with either 3.3V MPU or 5V MPU.

Baudrate generator

SC16IS750/752 has baudrate generator.
Since the communication speed is caluculated by dividing the frequency of the crystal, an error may occur depending on the communication speed.
How to divide is described in the data sheet.
For example, if you use a 3.072MHz crystal and set the communication speed to 3600bps, you need to divide the crystal frequency by 53.3333.
Since such a value cannot be set in the register, sets 54 in the register.
As a result, the actual communication speed will be 3555bps.
This calculation can be calculated with the following code.

#include <stdio.h>
void main() {
  long crystal_freq = 3072000; // 3,072,000MHz
  long prescaler = 1;
  long baudrate = 3600;
  long divisor1 = crystal_freq/prescaler;
  long divisor2 = baudrate*16;
  double divisorf = (double)divisor1/(double)divisor2;
  long divisor = divisorf + 0.999;
  printf("divisor1=%ld divisor2=%ld divisor=%ld divisorf=%f\n",
    divisor1, divisor2, divisor, divisorf);

  long actual_baudrate = (divisor1/divisor)/16;
  printf("actual_baudrate=%ld\n", actual_baudrate);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.