djuseeq / Ch376msc

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

interfacing ch376s module with build in sd #67

Open tsctrl opened 2 years ago

tsctrl commented 2 years ago

hi @djuseeq,

thank you for this great library. i saw quite heavy mode required to interface the board with sd. i saw ch376s module sold on ali with build in sd as below:

Screenshot_20220316-234617_AliExpress

i am not sure if this board use sd as storage and the usb port as com interface or both act as flash storage but i hope by any chance to have this board supported by your library. it would be great to have this library compatible with sd without require to do the mods mentioned for the current supported module. let me know how i can sent you a module. will try my best to ship this to you.

thank you.

djuseeq commented 2 years ago

Hi @tsctrl , thanks it's my pleasure. Yes it's need some tinkering with the board if someone want it to use for SD as well. I think the board on the photo is a developement board, so that should be ok. The library supports the SD card mode, with calling setSource(srcDrive); function, where srcDrive's value can be a 0 = USB(default), 1 = SD card mode. Please check the example file , and enable the ability to use SD card in line 59, but be careful with it if you use a normal CH376 module, in this case you must to do some modification on the board otherwise you risking to damage the CH chip.

tsctrl commented 2 years ago

hi @djuseeq, thank you for your reply. could you elaborate more which modification in the normal ch376 board that was required to avoid the ch376 chip damage?

is the modification shown is to hook the sd to connect to vcc, gnd and ch376 dedicated sd pins. do this modification is only relate to ch376 and not ch376s chip? i am not able to find the different between both chip version. i could see dedicated pin to connect the sd in schematic so iam wondering if this modification is to connect to this pins or is a some other approach?

thank you!

djuseeq commented 2 years ago

CH376S can handle SD card, CH376T not. HERE is a little note how i made it with this "blue" modul. For some reason the SD_CS pin is connected to the ground on the pcb and that not make any problem as long as you use with USB only. So check with these pins with DMM against VCC and GND, is any of them is shorted to these lines then you have to isolate it otherwise you risk to damage the chip.