Skip to content

YO5PBG Wavelenght

Amateur Radio, QRP, Home Made

just the sketch, more later:

//MADE BY YO5PBG AFTER READING: http://qsl.net/n9zia/mc145158/index.html

int clk = 9;
int data = 8;
int ena = 7;
int led = 13;
void setup() {
// initialize the digital pin as an output.
pinMode(clk, OUTPUT);
pinMode(data, OUTPUT);
pinMode(ena, OUTPUT);
pinMode(led, OUTPUT);
digitalWrite(clk, LOW);
digitalWrite(data, LOW);
digitalWrite(ena, LOW);
}
void loop() {
digitalWrite(led, HIGH);
delay(100);
// Load /R counter with a value of ####, MSB first  //14400 –> 1khz, 2880 –> 5khz, 14.4MHz XO
zero();       // 8192
zero();       // 4096
one();         // 2048
zero();         // 1024
one();          // 512
one();        // 256
zero();         // 128
one();         // 64
zero();         // 32
zero();          // 16
zero();         // 8
zero();         // 4
zero();       // 2
zero();       // 1
one();         // CONTROL, R = 1

enabl();       // ENABLE

// Load /N counter with a value of 621, MSB first
one();         // 512
zero();        // 256
zero();        // 128
one();           // 64
one();        // 32
zero();         // 16
one();        // 8
one();          // 4
zero();        // 2
one();           // 1
// Load /A counter with a value of max. 39 for :40 prescaler, MSB first
zero();       // 64
one();      // 32
zero();      // 16
zero();       // 8
zero();         // 4
zero();        // 2
zero();        // 1
zero();        // CONTROL, N & A = 0

enabl();      // ENABLE
digitalWrite(led, LOW);
delay(500);
digitalWrite(led, HIGH);
delay(10000);

}

// zero:
void zero(){
digitalWrite(data, LOW);     // Load 0 on data
//delay(100);
digitalWrite(clk,HIGH);    // bring clock HIGH
//delay(100);
digitalWrite(clk,LOW);     // Then back low

}
// one:
void one(){
digitalWrite(data, HIGH);    // Load 1 on DATA
//      delay(100);
digitalWrite(clk,HIGH);    // Bring pin CLOCK high
//    delay(100);
digitalWrite(clk,LOW);    // Then back low

}
void enabl(){
digitalWrite(ena, HIGH);   // Bring ENABLE high
//    delay(100);
digitalWrite(ena, LOW);    // Then back low

}

%d bloggers like this: