djuseeq / Ch376msc

Arduino library for CH376 mass storage contoller
MIT License
77 stars 17 forks source link

ch376s not working with esp32 #65

Closed microElabDevelop closed 2 years ago

microElabDevelop commented 2 years ago

i try to run ch376 use module with SPI interface , i m using esp32 controller, i try but not succeed, i littel bit consue about connection hai jumper setting related to spi. plz give me connection diagram and, example code.

WR > GND RD > GND CS > 3V3 D7 > pin_spi_miso= esp32 ->D19 D6 > pin_spi_mosi= esp32 ->D23 D5 > pin_spi_sck = esp32 ->D18 D3 > pin_ch376_cs= esp32 ->D5 INT > pin_ch376_int =NOT USE Ch376msc flashDrive(5); I USE THIS SETTING.

djuseeq commented 2 years ago

Hi. It was discussed here #18 . Do you have attached other device as well to the SPI? Try using with INT pin involved. Ch376msc flashDrive(5, INTPIN);

microElabDevelop commented 2 years ago

No i m only try to run ch376 with spi. I read the link. Can u explain me Fs=usb And Spi speed.?

djuseeq commented 2 years ago

The default SPI speed is 125kHz. If you want to use higher speed then you can choose from two macro for that when you instantiate CH object. In a kilohertz range use e.g Ch376msc flashDrive(5, INTPIN, SPI_SCK_KHZ(500) ); ,this will have the SPI clock at 500kHz, or in megahertz range use Ch376msc flashDrive(5, INTPIN, SPI_SCK_MHZ(8) ); for 8MHz.

microElabDevelop commented 2 years ago

thanx for helping me , problem is that , im confusing in spi mode or parallel mode,, Tx jumper remove from GND .