Archives for category: Own Code

One more time a discription of serial communication between an Arduino and a Processing sketch. But this time the important steps in making up a serial connection between an random serial device to the Arduino, which itself has a another serial communication to the pc running a Processing programm.

Read the rest of this entry »

First of all I emphasize that unfortunately none the following attempts of reprogramming fused AVRs was successful in my case. Therefore this is more a personal documentation of what did not work, rather than a tutorial on how to get AVRs reprogrammed.

The general problem is, that once the fuse bits of an AVR are set to except an external clock source, the AVRs can in theory only be reprogrammed when they have that external clock source during the reprogramming process as well. In practice it is much more complicated.

Read the rest of this entry »

First I had to get some S-code programm and flash the ATtiny85 AVR microcontroller chip. Luckily my supervisor had some first assembler source code for a RFID tag on his github. For the sake of completeness I have left all the comments in the following code, because they give detailed specific informations on this topic. File ‘avrfid.S‘:

 * Software-only implementation of a passive low-frequency RFID tag,
 * using an AVR microcontroller.
 * Version 1.1, 2010-06-15

Read the rest of this entry »

I was possible to get the RDM630 printing out the correct ID Numbers in the hex format. In the decimal format I am still struggling with some missing zeros now and then. It is my goal to have the IDs in decimal format, with all IDs having the same length. The wiring of the SM125 still has to be checked.

First of all the RDM630 uses the TTL Interface RS232 Data output format. The raw data has to be split and converted, to get the actual IDs. A look on the ASCII Table helps in the final conversion step:

Output date(HEX): 02 | 30 31 30 30 30 37 33 34 45 30 | 44 32 | 03
->Change to Decimal
CardNumber Decimal: 48 49 48 48 48 55 51 52 69 48
CheckSum Decimal: 68 50
->Refer to ASCII table,get Ascill value
CardNumber Ascill: 0 1 0 0 0 7 3 4 E 0
CheckSum Ascill : D 2
(01H) xor (00H) xor (07H) xor (34H) xor (E0H) = D2H

I found some more detailed information in the arduino forum, while searching for the hex dec conversion issue:

Two transmitted Bytes form one Hex ID block.
Hex ID blocks:      6   2    |    E   3    |  0     8    |  6     C   |  E     D
Received Bytes: 36H 32H | 45H 33H | 30H 38H | 36H 43H | 45H 44H

This is my code:

#include <SoftwareSerial.h>
#define rxPin 6
#define txPin 7

unsigned char hex_input;
int rx_bytes[] = {0,0,0,0,0,0,0,0,0,0,0,0};
String tag_nr;
String tag_nr_hex;
String checksum;
String checksum_hex;

//create a Serial object RFID
SoftwareSerial RFID= SoftwareSerial(rxPin, txPin);

void setup(){
Serial.println("Serial Ready");
Serial.println("RFID Ready");
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);

void loop(){
if (RFID.available()>0){
hex_input =;

if (hex_input == 2){ //Start of TTL Interface RS232 Data output format
int i = 0;
while (hex_input != 3){ //If it is not the end of TTL Interface RS232 Data output format
hex_input =;

if(hex_input != 3){//If it is not the end of TTL Interface RS232 Data output format
rx_bytes[i] = hex_dec_convert(hex_input);

tag_nr += rx_bytes[i]; //filling up a string with the card number
tag_nr_hex += hex_input;
} else {
checksum += rx_bytes[i]; //filling the checksum
checksum_hex += hex_input;
Serial.println(String("ID is --> decimal: " + tag_nr + " with checksum: " + checksum + ", hexadecimal: " + tag_nr_hex + " with checksum_hex: " + checksum_hex));
tag_nr = "";
tag_nr_hex = "";
checksum = "";
checksum_hex = "";

int hex_dec_convert(unsigned char hex_in){
unsigned char hexDigit = toupper(hex_in);
int digit = (hexDigit >= 'A') ? hexDigit - 'A' + 10 : hexDigit - '0';
return digit;

For the ‘hex_dec_convert’ method one more messageboard post helped me out. The consol output for reading four different RFID tags, looked like this:

Serial Ready
RFID Ready
ID is –> decimal: 45005214686 with checksum: 77, hexadecimal: 52534848535069545654 with checksum_hex: 5555
ID is –> decimal: 4500531325 with checksum: 20, hexadecimal: 52534848535149515053 with checksum_hex: 5048
ID is –> decimal: 1029102081218 with checksum: 812, hexadecimal: 65505765504856674956 with checksum_hex: 5667
ID is –> decimal: 4500530218 with checksum: 012, hexadecimal: 52534848535148504956 with checksum_hex: 4867

As I said, I want to get all IDs printed with the same length. Will post more updates, when I solved it!