CsrSpiDrivers icon indicating copy to clipboard operation
CsrSpiDrivers copied to clipboard

Issues with Arduino driver

Open ZeeRooo opened this issue 4 years ago • 3 comments

I have been trying to stablish a communication between my pc and BC417 through my Arduino (which has a CH340) and i put some prints in the Arduino sketch but nothing is received, seems like the driver is not sending information to the Arduino because https://github.com/Frans-Willem/CsrSpiDrivers/blob/master/spilpt.arduino/CsrSpiDriver/CsrSpiDriver.ino#L32 is always empty. First, just to make sure the driver IS working, i built the LPT fixed version and worked as expected in an old LPT compatible motherboard that i have lying around, so i decided to replace all LPT to COM, but i didn't work (again, nothing were send to the Arduino). Last, reading the CH340 datasheet i saw that 256000bauds is not supported, so i changed to other speeds (like 115200) in both Arduino sketch and https://github.com/Frans-Willem/CsrSpiDrivers/blob/master/spilpt.arduino/CsrSpiDriver/CsrSpiDriver.ino#L32

I understand that it's an old project and also something finished for you, but can you point me out what to look? Thanks.

PS: I'm using Uno R3.

ZeeRooo avatar Jul 25 '20 02:07 ZeeRooo

Years ago, I've manage to use the BitBang version, I've changed the Baud rate of the DLL & the sketch to, .. I don't remember what .... and it still worked

Note - the Serial is not meant for interfacing the BCxxx! Rather it's the interface between the PC & Arduino

hllhll avatar Jul 27 '20 10:07 hllhll

@hllhll What do you mean with your note? I'm not supposed to be able to use my Arduino as an ISP programmer for the BC?

ZeeRooo avatar Jul 28 '20 04:07 ZeeRooo

I'll rephrase my comment. The Arduino acts as the middleman between the BCxxx and the PC; The arduino interacts with the chip via SPI (See setup https://github.com/Frans-Willem/CsrSpiDrivers/blob/master/spilpt.arduino/CsrSpiDriver/CsrSpiDriver.ino#L21 ) And interacts with the PC Using the arduino Serial port.

In your question you mentioned CH340 - I Thought it has to do with the BCxxx (but googling I see it's not, rather the communication with the PC, I Guess that's my mistake ^_^).

Anyway, if you change the speed on the .ino; You should also change it in the .DLL For the regular sketch https://github.com/Frans-Willem/CsrSpiDrivers/blob/master/spilpt.arduino/basics.cpp#L131: For bitbang: https://github.com/Frans-Willem/CsrSpiDrivers/blob/master/spilpt.arduino.bitbang/basics.cpp#L129

hllhll avatar Jul 28 '20 05:07 hllhll