K8055

Hello
I tried to read keyboard 4*4 with k8055, but I can’t get it work.
Simplified examble:
I have connected(wired) output #3 to input # 3
Setting output 3 to 6 one after another and so on 3,4,5,6,3,4,5…
Then I read digital inputs
When output 3 is ‘1’ I should get ‘1’ reading digital input, but I didn’t get.
Put the program(VB) gets ‘1’ while output #6 is ‘1’ or #5 or #4 depending on timer1.interval!!!

BR
Timppa

Maybe the K8055 is too slow to read a keyboard.

BTW: When the output is set to ‘1’ the output transistor is ON and the input where you connected it is read as ‘0’.

Are you sure?
Run your Demo program.
Out to ULN 2803 is inverting to connector O3
In to ULN 2803 from connector I3 is inverting also.
Main question is, why I get input I3 ‘set’ when other output than O3 is ‘set’ depending on timer interval?
100ms interval is enough to read 4*4 keyboard.
When the interval is higher ther is still that proplem.

You are right, I was wrong about the input state.
Indeed, the input low is displayed as ‘1’.

Answer to your other question may be some delay.
Difficult to say what…
Is there same problem if you increase the timer interval to about 1s ?

Yes, here is the same problem with 1s.
If I write
cleardigitalchannel 3
setdigitalchannel 4
bits=readalldigitalchannel

So is the run order in K3055 just that?

One test version was only one command/interval and same problem.

BRG
Timppa

The order should be that.
Anyhow, the faster way is to use WriteAllDigital(Data).

Yes, I have tried , same problem.

Do you get ‘1’ from input #3 if you in the demo software set output #3 to ‘0’ and the other outputs #4 to #6 to ‘1’?

Only one output ‘1’ at a time.
o3 connected to i3

o3,o4,o5,o5
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
1 0 0 0
0 1 … and so on

I get i3 ‘1’ while o4,o5 or o6 is set depending on timer.interval

maybe this helps you?

It seems that I have to do some more tests by changing the timer interval. Very strange behaviour indeed…

I made a test:
First I connected the digital outputs (1 to 5) to corresponding digital inputs.
In the VB6 demo software I disabled the timer 1 by commenting the line:

'If h >= 0 Then Timer1.Enabled = True

Then I changed the output test procedure (Timer2) following way:
I added the line i = ReadAllDigital and the lines below it.
After the click of the “Output Test” button I see how the check mark is scrolling in the input check boxes. This should indicate that the inputs are read correctly. This seems to work even with timer interval of 1.
Do this work if you copy the following code to the demo?
BTW: Are you using the latest DLL:
k8055dll_rev3_0_2.zip ?

[code]Private Sub Timer2_Timer()
Dim i As Long
ClearDigitalChannel n + 1
Check3(n).Value = 0
n = n + 1
If n = 8 Then n = 0
SetDigitalChannel n + 1
Check3(n).Value = 1

i = ReadAllDigital
Check2(0).Value = (i And 1)
Check2(1).Value = (i And 2) / 2
Check2(2).Value = (i And 4) / 4
Check2(3).Value = (i And 8) / 8
Check2(4).Value = (i And 16) / 16

End Sub [/code]

Hello!
My test results according to your modifications.

Timer2.interval=10
inputs are set ramdom, almost no input at all

Timer2.interval=100
same as 10

Timer2.interval=500
Inputs are one after outputs
o1 = no input
o2 => i1
o3 => i2
.
.
Timer2.interval=1000
same as 500

dll’s are up to date

There must be someting wrong in my environment?
Thaks for you.

BRG
Timppa

Strange problem indeed.
BTW: Do you have a lot of other USB devices connected to your PC?

No, only this one USB.
I’ll download VB SP’s first.
I’ll get back to it later.
Timppa

I give up.
I have done all the VB updates and I have still the same problem.
AVR atmega32 and serial communication is the next step.
When I run K8055 demoprogram ,so after that the memorystick stops
working. I must remove it and but it back so it’s OK again.
Thanks however and Merry Christmas!

Terveisin Timppa :cry:

Sorry about the problem that can’t be solved.
Anyhow, Merry Christmas!