hi @horace
I made another program, a little more complicated than this one until here.
You can check the --other-- code here How to drive manually HT1621B LCD driver IC?
I managed to adapt only a fragment of the code from this other code, into our code. And it is working ! Is supposed to lit up some segments on a LCD. That's all this code is doing.
I also simplified your code a tiny bit with this occasion.
-
-
-
-
- the problem:
You see thoseThread.Sleep(100);
lines from time to time.
I had to include them, for the code to work correctly.
Without them, I get a lot of [Very Random] errors !
Here and there, and is messing up the output result (on my LCD).
- the problem:
-
-
-
So my question to you, is like this:
If arduino can transmit the same data and in even greater quantity than my test code here, why my test code is so slow to send? Or it is another detail that we should implement for faster speeds? or is not 'the speed' but something else that is influencing this data transmission 'speed' ? Or explain to me in detail what the hell is going on, on the arduino side, then on C# side, then in serial COM side, because I start to believe these 3 have different 'speeds' ? maybe? but what is the limit for each?
-How can you solve this problem, please, and thank you.
Im using this C# code to actually drive another IC.
I also had to declare some new functions for this DataBits() to work.
This is C# code, not arduino. It is arduino code inside C#, adapted code. Ok?
void DataBits()
{
//ADR DATA
//sendData(0, 0b0011); //-,c,b,
Thread.Sleep(100);
digitalWrite(_pin_cs, LOW);
//shiftOutBits(3, 0b101); //Start 101
//val = (bit(x - 1) & value) != 0;
//0
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 1);
digitalWrite(_pin_wr, HIGH);
//1
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
//2
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 1);
digitalWrite(_pin_wr, HIGH);
Thread.Sleep(100);
//shiftOutBits(6, address); //where address=0
//1
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
//2
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
//3
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
//4
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
//5
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
//6
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0);
digitalWrite(_pin_wr, HIGH);
Thread.Sleep(100);
//shiftOutBits(4, value); //where value=0b0011
//1
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 0); //null
digitalWrite(_pin_wr, HIGH);
//2
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 1); //c
digitalWrite(_pin_wr, HIGH);
//3
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 1); //b
digitalWrite(_pin_wr, HIGH);
//4
digitalWrite(_pin_wr, LOW);
digitalWrite(_pin_data, 1); //a
digitalWrite(_pin_wr, HIGH);
Thread.Sleep(100);
digitalWrite(_pin_cs, HIGH);
//END of DataBits()
}