ST7735(パラレル)搭載した基板を作りたい(未完了プロジェクト?)

目的
収まりよく液晶を搭載してArduino等(3.3V)に直接繋げる
基板を作りたい



ソフト


https://qiita.com/caa45040/items/5035e9753f8123fa6eb4

-------------------------------------------------

液晶　秋月のATM0177B5

![o_cop612.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/baff8769-0217-70e7-7a22-90c6b087d570.jpeg)

-------------------------------------------------

完成イメージ

![o_cop597.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/9124b476-b016-7ee1-5732-523ac716f924.jpeg)


-------------------------------------------------

回路

![o_cop599.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/1e8b4b00-f072-56f6-f911-ba0a11aeb7b5.jpeg)



![o_cop598.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/7c372ffd-431e-7db5-0718-42017c0b56d0.jpeg)


![o_cop578.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/5fda7c48-199d-1755-dfad-8447ff291711.jpeg)

![o_cop601.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/9462ab63-d648-816a-5275-c2c4b0d205e2.jpeg)

![o_cop602.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/f2db4195-11ae-484e-60e6-b7b70d8d0183.jpeg)

![o_cop603.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/4bf56754-9945-e4f1-f684-0df808fe0071.jpeg)

-------------------------------------------------

試作


![o_cop593.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/7e6fd110-f0be-513c-7ffa-9dd9dbd98f9d.jpeg)

![o_cop594.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/0a76a9f3-5c15-a73d-506e-d472d7cd7f94.jpeg)

![o_cop595.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/1c0b4ff0-a836-a24e-3c79-9b54945070a8.jpeg)

![o_cop596.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/0a0be3a9-2b85-3253-3647-d0f156b86253.jpeg)


--------------------------------------------------

配線

7 - DB7(17)
6 - DB6(18)
5 - DB5(19)
4 - DB4(20)
3 - DB3(21)
2 - DB2(22)
1 - 未接続
0 - 未接続

A0 - REST(28)
A1 - RS(27)
A2 - WR(26)
A3 - RD(25)
A4 - DB0(24)
A5 - DB1(23)


-----------------------------------------------------

プログラム

![o_cop600.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/840352/4ac7e4e6-4794-7497-a5a1-b3bc415e47c8.jpeg)


```c++

//GPIO_st7735_TEST_MINI2_071_1

//GPIO
#define GPIO_A0(s) digitalWrite(A0,s)
#define GPIO_A1(s) digitalWrite(A1,s)
#define GPIO_A2(s) digitalWrite(A2,s)
#define GPIO_A3(s) digitalWrite(A3,s)

void GPIO_8BIT(int s)
{
  digitalWrite( 7, (s >> 7) & 0x01);
  digitalWrite( 6, (s >> 6) & 0x01);
  digitalWrite( 5, (s >> 5) & 0x01);
  digitalWrite( 4, (s >> 4) & 0x01);
  digitalWrite( 3, (s >> 3) & 0x01);
  digitalWrite( 2, (s >> 2) & 0x01);
  digitalWrite(A5, (s >> 1) & 0x01);
  digitalWrite(A4, s & 0x01);
} //GPIO_8BIT

//コマンドの書き込み
void LCD_Write_CMD(int a)
{
  GPIO_A1(0); //A0=0;
  GPIO_8BIT(a);//P1=a; data
  GPIO_A2(0);//WRB=0;
  GPIO_A2(1);//WRB=1;
} //LCD_Write_CMD


//データ書き込み
void LCD_Write_Data(int a)
{
  GPIO_A1(1);//A0=1;
  GPIO_8BIT(a);//P1=a; data
  GPIO_A2(0);//WRB=0;
  GPIO_A2(1);//WRB=1;
} //LCD_Write_Data


//液晶の初期化処理
void TXDT144TF_ST7735S_Init(void)
{

  //----------  ST7735S Reset Sequence  --------//

  GPIO_A0(1);//LCD_RESET=1;

  delay(1); //Delay 1ms

  GPIO_A0(0);//LCD_RESET=0;

  delay(1); //Delay 1ms

  GPIO_A0(1);//LCD_RESET=1;

  delay(120); //Delay 120ms

  LCD_Write_CMD(0x01);//SOFTWARE RESET
  delay(50);

  LCD_Write_CMD(0x11);//SLEEP OUT
  delay(200);

  LCD_Write_CMD(0x29);//display on
  delay(100);

  LCD_Write_CMD(0x3a);//Interface pixel format
  LCD_Write_Data(0x05);//16bit mode
  delay(100);

  LCD_Write_CMD(0x36);//RGB-RGR format
  LCD_Write_Data(0x08);//RGB mode
  delay(100);


  //画面の書き込み開始
  LCD_Write_CMD(0x2C); //memory write

  for(int i=0;i<128*10;i++){
  LCD_Write_Data(0xff);
  LCD_Write_Data(0xff);
  } //for

  //RGB
  for(int i=0;i<128*10;i++){
    LCD_Write_Data(0b11111000); //red
    LCD_Write_Data(0b00000000);
  } //for

} //TXDT144TF_ST7735S_Init


//初期化
void setup() {

  //ポートのモード設定
  //アウトプットモード
  pinMode(13, OUTPUT);
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);

  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);


  //ポートの初期化
  GPIO_A3(1);//RD=1
  GPIO_A2(0);//WR=0
  GPIO_A1(0);//RS=0
  GPIO_A0(1);//RESET=1

  delay(500); //0.5秒待つ

  //液晶の初期化処理
  TXDT144TF_ST7735S_Init();

} //setup


//メインループ
void loop() {

  digitalWrite(13, HIGH);
  delay(1000); //0.2秒待つ

  digitalWrite(13, LOW);
  delay(1000); //0.2秒待つ

} //loop

```