Giter Club home page Giter Club logo

Comments (19)

modi12jin avatar modi12jin commented on June 14, 2024 1

@Architeuthis-Flux I did not find the English version of the manual, but I made some efforts to translate the Chinese manual into the English version of the manual.

google-chrome_20211122154430

CH446DS1_English.pdf

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

The CH446Q is an 8x16 matrix analog switch chip. The CH446Q contains 128 analog switches which distributed at each intersection of the 8x16 signal path matrix, each analog switch can be turned on or off independently, enabling arbitrary routing of 8x16 signal paths.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

CH446Q

In parallel address input mode, CH446Q is basically compatible with MT8816, but the package and pins are different. The difference is 8x16
Some pins of the X port of the matrix analog switch are different (or their addressing is different), please refer to the table below for the differences.

@Architeuthis-Flux

from breadware.

Architeuthis-Flux avatar Architeuthis-Flux commented on June 14, 2024

Yeah, I've looked into that early on but it may be worth getting a few of those to see how they perform. The serial addressing would be really nice to make everything a bit simpler, and the smaller package would allow me to fit more of them on each board. I vaguely remember the operating voltage being lower but I'll pull up both datasheets to compare. @modi12jin Any chance you've found one in english?

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

Analog switch chip

model Function description Typical power supply (VDD) Typical internal resistance Typical bandwidth Signal voltage Encapsulation Application signal recommendation
CH446Q 16*8 array 5V/12V 50Ω 50MHz VEE~VDD LQFP44 30Mbps
CH446X 24*5 array 5V/12V 50Ω 50MHz VEE~VDD LQFP44 30Mbps

from breadware.

Architeuthis-Flux avatar Architeuthis-Flux commented on June 14, 2024

Thanks for the translation, it's much nicer to read than the raw Google Translate version. I really appreciate it.

I think I'm going to try out a version with 12 CH446X's on the top board, so every 5 breadboard rows are the Y pins and then I'll have 24 backend connections to route 2 lines to every other chip and the 2 extra lines go to the special function crosspoint chip on the bottom board (or power and ground, and then I'd need to come up with a new scheme for routing special functions, maybe I'll add another chip that handles the power rails and special functions.) I guess logically it would be similar to using 8 CH446Q's, I need to map it all out on paper and see if I can come up with a clever solution for all that.

I'm assuming you're in China, and I'm wondering if you might have a way of finding these chips for less than the $2.30 USD each that I just payed on Aliexpress.

Feel free to join the project on Hackaday.io so we can use the project chat too.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

@Architeuthis-Flux You guessed it, I was in China, and it was about $1.3 if I bought it on Chinese Taobao. If you buy in large quantities, it is recommended to find official sales or large distributors, the price will be lower because of the quantity you buy.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

@Architeuthis-Flux What kind of MCU is used to control CH446X? It only supports serial communication. I can't see how to reuse and replace SPI. You may need 48 (12×4) GPIOs.

I plan to use ESP32-C3 as a controlled terminal. For the control end, I may need CH446Q, I need 8 CH446Q. The MCU on the control side needs 32 (4×8) GPIOs.

from breadware.

Architeuthis-Flux avatar Architeuthis-Flux commented on June 14, 2024

@modi12jin It's hard to be 100% sure from these short datasheets, but if I understand it correctly once you set an address for each chip, they can be bussed together and all share the same 4 lines ignoring any command that doesn't start with that chip's 7 (or 8) bit address. So if you set the address before soldering them onto the board, you could control them all with only 4 pins. As for how non-volatile that stored address is, I don't know. To be safe it might be worth coming up with a way to individually set them at startup, but that adds 12 (or 24) more pins unless come clever multiplexing scheme is used.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024
#include <Arduino.h>

#define RST 4
#define STB 19
#define SK  18
#define DAT 23

#define LED 5

//CH446Q初始化
void CH446Q_Init(){
  pinMode(STB,OUTPUT);
  pinMode(DAT,OUTPUT);
  pinMode(SK,OUTPUT);
  pinMode(RST,OUTPUT);
  digitalWrite(RST,1);
  delay(50);
  digitalWrite(RST,0);
}

//发送地址和状态
void CH446Q_SendAddr_Switch(uint8_t addr,bool data){
  uint8_t ByteCnt;

  digitalWrite(STB,0);
  digitalWrite(DAT,0);

  delay(20);

  for(ByteCnt=0;ByteCnt<8;ByteCnt++){
    digitalWrite(SK,0);
    delay(10);

    if(addr & 0x80){
      digitalWrite(DAT,1);
    }else{
      digitalWrite(DAT,0);
    }
    digitalWrite(SK,1);
    delay(50);
    addr <<=1;
  }

  digitalWrite(SK,0);

  if(data == 1){
    digitalWrite(DAT,1);
  }else{
    digitalWrite(DAT,0);
  }

  delay(40);
  digitalWrite(STB,1);
  delay(20);
  digitalWrite(STB,0);
  delay(20);
}

void setup() { 
  CH446Q_Init();
  CH446Q_SendAddr_Switch(0x01,1); //Y0-X1连接
  CH446Q_SendAddr_Switch(0x7F,1); //Y7-X15连接
  pinMode(LED,OUTPUT);
}

void loop() {
  digitalWrite(LED,1);
  delay(1000);
  digitalWrite(LED,0);
  delay(1000);
}

ESP32-CH446Q

ESP32-CH446Q测试

@Architeuthis-Flux Test success! I haven't tested whether GPIO can be reused

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

CH446Q.cpp

#include "Arduino.h"
#include "CH446Q.h"

CH446Q::CH446Q(int8_t rst,int8_t stb,int8_t sk,int8_t dat){
     _rst=rst;
     _stb=stb;
     _sk=sk;
     _dat=dat;
}

//CH446Q复位
void CH446Q::Reset(void){
  digitalWrite(_rst,1);
  delay(50);
  digitalWrite(_rst,0);
}

//CH446Q初始化
void CH446Q::Init(void){
  pinMode(_stb,OUTPUT);
  pinMode(_rst,OUTPUT);
  pinMode(_sk,OUTPUT);
  pinMode(_dat,OUTPUT);
  CH446Q::Reset();
}

//发送地址和状态
void CH446Q::SendAddr_Switch(uint8_t addr,bool data){
  uint8_t ByteCnt;

  digitalWrite(_stb,0);
  digitalWrite(_dat,0);

  delay(20);

  for(ByteCnt=0;ByteCnt<8;ByteCnt++){
    digitalWrite(_sk,0);
    delay(10);

    if(addr & 0x80){
      digitalWrite(_dat,1);
    }else{
      digitalWrite(_dat,0);
    }
    digitalWrite(_sk,1);
    delay(50);
    addr <<=1;
  }

  digitalWrite(_sk,0);

  if(data == 1){
    digitalWrite(_dat,1);
  }else{
    digitalWrite(_dat,0);
  }

  delay(40);
  digitalWrite(_stb,1);
  delay(20);
  digitalWrite(_stb,0);
  delay(20);
}

CH446Q.h

#ifndef  __CH446Q_H__
#define  __CH446Q_H__

#include "CH446Q.h"

#define Y0_X0 0x00
#define Y0_X1 0x01
#define Y0_X2 0x02
#define Y0_X3 0x03
#define Y0_X4 0x04
#define Y0_X5 0x05
#define Y0_X6 0x06
#define Y0_X7 0x07
#define Y0_X8 0x08
#define Y0_X9 0x09
#define Y0_X10 0x0A
#define Y0_X11 0x0B
#define Y0_X12 0x0C
#define Y0_X13 0x0D
#define Y0_X14 0x0E
#define Y0_X15 0x0F

#define Y1_X0 0x10
#define Y1_X1 0x11
#define Y1_X2 0x12
#define Y1_X3 0x13
#define Y1_X4 0x14
#define Y1_X5 0x15
#define Y1_X6 0x16
#define Y1_X7 0x17
#define Y1_X8 0x18
#define Y1_X9 0x19
#define Y1_X10 0x1A
#define Y1_X11 0x1B
#define Y1_X12 0x1C
#define Y1_X13 0x1D
#define Y1_X14 0x1E
#define Y1_X15 0x1F

#define Y2_X0 0x20
#define Y2_X1 0x21
#define Y2_X2 0x22
#define Y2_X3 0x23
#define Y2_X4 0x24
#define Y2_X5 0x25
#define Y2_X6 0x26
#define Y2_X7 0x27
#define Y2_X8 0x28
#define Y2_X9 0x29
#define Y2_X10 0x2A
#define Y2_X11 0x2B
#define Y2_X12 0x2C
#define Y2_X13 0x2D
#define Y2_X14 0x2E
#define Y2_X15 0x2F

#define Y3_X0 0x30
#define Y3_X1 0x31
#define Y3_X2 0x32
#define Y3_X3 0x33
#define Y3_X4 0x34
#define Y3_X5 0x35
#define Y3_X6 0x36
#define Y3_X7 0x37
#define Y3_X8 0x38
#define Y3_X9 0x39
#define Y3_X10 0x3A
#define Y3_X11 0x3B
#define Y3_X12 0x3C
#define Y3_X13 0x3D
#define Y3_X14 0x3E
#define Y3_X15 0x3F

#define Y4_X0 0x40
#define Y4_X1 0x41
#define Y4_X2 0x42
#define Y4_X3 0x43
#define Y4_X4 0x44
#define Y4_X5 0x45
#define Y4_X6 0x46
#define Y4_X7 0x47
#define Y4_X8 0x48
#define Y4_X9 0x49
#define Y4_X10 0x4A
#define Y4_X11 0x4B
#define Y4_X12 0x4C
#define Y4_X13 0x4D
#define Y4_X14 0x4E
#define Y4_X15 0x4F

#define Y5_X0 0x50
#define Y5_X1 0x51
#define Y5_X2 0x52
#define Y5_X3 0x53
#define Y5_X4 0x54
#define Y5_X5 0x55
#define Y5_X6 0x56
#define Y5_X7 0x57
#define Y5_X8 0x58
#define Y5_X9 0x59
#define Y5_X10 0x5A
#define Y5_X11 0x5B
#define Y5_X12 0x5C
#define Y5_X13 0x5D
#define Y5_X14 0x5E
#define Y5_X15 0x5F

#define Y6_X0 0x60
#define Y6_X1 0x61
#define Y6_X2 0x62
#define Y6_X3 0x63
#define Y6_X4 0x64
#define Y6_X5 0x65
#define Y6_X6 0x66
#define Y6_X7 0x67
#define Y6_X8 0x68
#define Y6_X9 0x69
#define Y6_X10 0x6A
#define Y6_X11 0x6B
#define Y6_X12 0x6C
#define Y6_X13 0x6D
#define Y6_X14 0x6E
#define Y6_X15 0x6F

#define Y7_X0 0x70
#define Y7_X1 0x71
#define Y7_X2 0x72
#define Y7_X3 0x73
#define Y7_X4 0x74
#define Y7_X5 0x75
#define Y7_X6 0x76
#define Y7_X7 0x77
#define Y7_X8 0x78
#define Y7_X9 0x79
#define Y7_X10 0x7A
#define Y7_X11 0x7B
#define Y7_X12 0x7C
#define Y7_X13 0x7D
#define Y7_X14 0x7E
#define Y7_X15 0x7F

class CH446Q{
  public:
    CH446Q(int8_t rst,int8_t stb,int8_t sk,int8_t dat);

    void Reset(void);
    void Init(void);
    void SendAddr_Switch(uint8_t addr,bool data);

  private:
    int8_t _rst, _stb,_sk,_dat;
    uint8_t addr;
};

#endif

main.cpp

#include "Arduino.h"
#include "CH446Q.h"

#define RST 4
#define STB 19
#define SK  18
#define DAT 23

#define STB_1 22

#define LED 5

CH446Q ch446q=CH446Q(RST,STB,SK,DAT);
CH446Q ch446q_1=CH446Q(RST,STB_1,SK,DAT);
 
void setup(){
     ch446q.Init();
     ch446q_1.Init();
     ch446q.SendAddr_Switch(Y0_X1,1);//Y0-X1连接
     ch446q.SendAddr_Switch(Y7_X15,1);//Y7-X15连接
     ch446q_1.SendAddr_Switch(Y0_X1,1);//Y0-X1连接
     pinMode(LED,OUTPUT);
}

void loop(){
  digitalWrite(LED,1);
  delay(1000);
  digitalWrite(LED,0);
  delay(1000);
}
WeChat_20211210151938.mp4

@Architeuthis-Flux I tried pin multiplexing. Except STB cannot be multiplexed, the other three (RST, DAT, SK) can be multiplexed.

from breadware.

Architeuthis-Flux avatar Architeuthis-Flux commented on June 14, 2024

Nice, I really like the idea of defining every internal connection as a hex value. That will make saving and reloading board states soooo much easier, and points to a solution for disconnecting rows.

It's also interesting that it doesn't have a messed up truth table (as far as I can tell) like the MT8816, which swaps X12 and X13 with X6 and X7 (or something like that, it's been a while) so you have to change that if you want to just send bytes to a port as hex.

I think I may use a couple (or 3) of these CH446s for the control board (to save space) and leave the MT8816s on the top side, after some discussion with non-techy people, they all liked the weight that those huge PLCC chips add to it. And having a huge ceramic package might help dissipate more heat so we can run them a bit further out of spec than we already are.

I'll get some work done on it soon but Christmas has me flying between my hometown and Mexico way too much to be consistent lately.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

fpgb

20220113101724

20220113101718

https://github.com/dotcypress/fpgb

@Architeuthis-Flux I don't know if you have seen this warehouse, and his idea may have a place worth learning.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024
22a1b9a43e46816e1826f10d8177e7a3.mp4

@Architeuthis-Flux (ST7789_SPI_240*240) There is no distortion in the case of 40MHZ, and the screen is directly black at 80MHZ.

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024
b5750833ce39440f6a622a033ddf93da.mp4

8080 interface parallel port 8-bit 20MHZ

from breadware.

modi12jin avatar modi12jin commented on June 14, 2024

@Architeuthis-Flux found that CH446Q is not very suitable for switch connection of power and ground, only for signal switch connection (because the current is too small). I have tested that the current cannot drive the ST7789 screen, but directly connecting the 3V3 on the ESP32 minimum system board can make it work normally

from breadware.

atlaste avatar atlaste commented on June 14, 2024

@modi12jin @Architeuthis-Flux The english datasheet of the CH446Q is available on the website here: http://www.wch-ic.com/downloads/CH446DS1_PDF.html

The pins seem 12v tolerant and it should be able to switch roughly 15mA of current if you drive them at 12v. Otherwise it's way less. That's at least how I interpret table 6.3. However, then you do need 5v logic to switch them, so an ESP32 that only does 3.3v won't cut it... easy enough to solve tho.

from breadware.

Architeuthis-Flux avatar Architeuthis-Flux commented on June 14, 2024

@atlaste Yeah, the specs do get way better as supply voltage goes up and temperature goes down.
On the Jumperless I'm actually driving them a few volts higher than they say you can in the Absolute Maximum Ratings (~+9V - -8.5V) and they seem to tolerate it fine. And signaling is done with an RP2040 at 3.3V which also works great.

And I've been testing pushing 100mA through them and haven't blown one up yet somehow.

There's also a very elusive app note out there somewhere that I can't find right now.

@modi12jin In my experience, when weird things are happening with getting a huge voltage sag when pulling any current, it's because I've messed up the addressing somehow and so a bunch of connections have been made that shouldn't be. So you end up with a voltage divider situation.

from breadware.

atlaste avatar atlaste commented on June 14, 2024

@Architeuthis-Flux Yes I noticed that while looking at the schematics.

When using 9v/-8.5v the VDD-GND=9v, so I'm not really surprised that you can drive them with 3.3v. VIH=2v for VDD-GND=5v and 3.3v for VDD-GND=12v; assuming linear scaling that means they should trigger at roughly 2.75v. TTL is at 2.7v so that seems to be just fine. They should go up to 100 mA, as long as you push <= 15 mA per pin according to the datasheet.

For most applications you probably don't even need the -8.5v, since you're only 0-9v through in reality?

I'd like to switch them at 12v for my pet project. But 3.3v for VIh is not going to cut it I suppose, so I guess that's not going to be working with a RP2040.

from breadware.

Related Issues (5)

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.