Comments (3)
Hi, thanks.
What communication interface you use? If its serial then you can choose a higher baud rate(up to 115200), in case of using SPI the default speed is low (125kHz) in sake of stability if e.g. using long cables on a breadboard , but you can use these function-like macros when creating an object : (in case of Arduino with 16MHz Sys Clock, the maximum value can be 8MHz, but on this speed the communication it can become unreliable.Try with short wires)
SPI_SCK_KHZ( )
or SPI_SCK_MHZ( )
.
E.g.
Ch376msc flashDrive( 10, SPI_SCK_MHZ(2) ); // CS pin, com speed
// or
Ch376msc flashDrive( 10, 9, SPI_SCK_MHZ(2) );// CS pin, INT pin, com speed
In addition, the module also needs some time to save the data stored in the buffer to the USB drive. Have you tried with another flash-drive or to format the drive with external software . To be easy to implement for Arduino, the library use blocking functions (wait for answer from module)
from ch376msc.
Thanks for your reply. I have done all of them. I am using SPI communication with 12MHZ SCK and every 128 bytes is written at 4 milliseconds. Is it normal?
from ch376msc.
Yes, that is normal ,we have to wait with the next command until the CH376 finish with file writing otherwise data loss will occur. The chip will inform the MCU when is ready to receive the next command or data. The most time consuming part is when writing continuously and the CH376 internal buffer(512byte) is filled up, then the chip require longer time to do some internal processes, this is much depends on the usb-drive used. Here you can find more details about the drives i have been used.
2GB no name drive, worst case is more than 91 ms waiting for the module.
32GB PNY, worst case is 3.5 ms waiting for the module.
from ch376msc.
Related Issues (20)
- how to read serial write to usb flash drive?
- interface with vs1053 HOT 1
- Maximum baud rate speed of HardwareSerial HOT 1
- DELETE EVERY SINGLE BIT HOT 3
- [SPI interface] USB is not detecting and Prints as Attach flash drive first! HOT 3
- info needed HOT 1
- Arduino Due not connecting to CH376 HOT 9
- Question: List/Select partition HOT 1
- getChipVer() returns 0xFF, but everything else works HOT 3
- CH376s SPI USB issues
- file name Limitations HOT 7
- ch376s not working with esp32 HOT 4
- readFileUntil() return "false" for both EOF and the record terminator HOT 3
- interfacing ch376s module with build in sd HOT 3
- Accessing USB Pendrive and SD Card consecutively! HOT 6
- Init function hangs the application HOT 2
- Volume Label Information
- Files are not created when called using separate fileOpen, fileWrite and fileClose functions
- i can't write string to flash drive. HOT 2
- "Flash Drive Attached" instability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ch376msc.