K8056 Relay Board. RS232 Checksum?

Hi all,

Im trying to send a command to the K8056 relay board using RS232. I have set all the comm settings correct(baud, stop bits ect.) The Velleman application controls the board fine. Im using the terminal in MikroC (Microelectronika) to send the commands. I dont understand how to work out the checksum byte.

For example i want to turn relay 1 on card address 1:

13 1 83 1 <-I have left out the checksum as im not sure how to find it.

Adding the last 4 bytes is ofcourse no problem but how do i get the 2’s compliment , Googled it but still dont get it.

Some simple examples for the check sum calculation with explanation would be great! :stuck_out_tongue:

Thanks VERY much :smiley:

For what you are trying to send this is:

= 13 = 0Dh

= 1 = 01h = ASCII "S" = 83 = 53h = ASCII "1" = 49 = 31h = ?

So your packet in hexadecimal notation looks like this: 0Dh 01h 53h 31h ??h

  1. To calculate the checksum take the sum of all bytes: 0Dh + 01h + 53h + 31h = 92h
  2. Invert all bits, this can easily be done by taking FFh and subtracting your result from it: FFh - 92h = 6Dh
  3. Add 1: 6Dh + 1 = 6Eh

Some extra info:
ASCII Table

Thanks for the support ill give it a try!

Hello!
I’ve baught K8056 & K8058 and every thig is working very well!

but i’d like to make a remote with more features.

First of all, your help is very clear, thank you!
In order to start my project, I’ve made a little program to test le transmition.

But it doesn’t work…

Here is the simulation trace.

Could you tell me what’s going wrong?

(I’ve also made my own emmiter with my new features but i also test my program on the K8058 PCB)

Sorry, we cannot assist with custom projects.
Please compare output of original K8058 with your project.

I’d like to!
but i have nothing to catch it.

Couldn’t you tell me what’s wrong?

could you confirm me that the rate is 2400bauds and a bit should be send during 417µs ???

I tried to make a shorter start bit but nothing occures event in direct link like if it was a RS232 port…

Please help.

Allez, s’il vous plait, aidez moi!

J’ai passé la semaine dessus et je ne trouve toujours pas.

Il doit bien y avoir quelque chose qui cloche…

Je n’ai pas d’oscilloscope pour regarder ce que donne la sortie de l’emetteur.

Est-ce le checksum? la durée d’émission des bits?

SVP!!!

Après 3 semaines à me tirer les cheveux, je me suis acheté un analyseur logique juste pour découvrir que les bits doivent êtres inversés.
Ca aurait été plus simple de me le dire… il suffisait juste d’ajouter un petit ~ dans mon code.

Enfin bon c’est pas grave.

Pour ceux que ca pourrait aider voici à quoi doit ressemble le signal pour la commande Toogle.