When you have a hammer, everything looks like a nail

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

My son totally surprised me last week by texting that he wanted to learn Morse code.  He's been using an app, but he needs a CPO (code practice oscillator).  I looked in my stash for a 555 chip but didn't have any.  What I did have was a little tiny44A board that I've used for WS2812 LED projects, so I programmed it to be a CPO.

 

To make this somewhat forum-related, what allowed me to pull this off is that I had added a jumper with 2 extra GPIO connections, "just in case".  I never used them for the WS2812 projects, but they were necessary for the CPO.  So if you have extra GPIO, bring a few out to some pads, "just in case".

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

-.-.--

Nice job, I was going to suggest the CPO kit by the 4 states QRP group. http://www.4sqrp.com/sscpo.php

 

 

-.-. --.-  -.-. --.-  -.. .  -.- .. ----- -... -.-

 

Jim

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Source code, in case anybody is interested.

 

#define F_CPU		1000000UL	// 1 MHz

#include <avr/io.h>
#include <util/delay.h>

#define SPKR_A		PA0
#define SPKR_B		PA1
#define KEY		PB0

#define CPO_FREQ	700	// hz
#define CPO_HALF_CYCLE	(F_CPU / CPO_FREQ / 2)


int main(void)
{
    DDRA = (1 << SPKR_A) | (1 << SPKR_B);
    PORTB = 1 << KEY;

    while (1) 
    {
	if (!(PINB & (1 << KEY)))	// key down
	{
	    PORTA = (1 << SPKR_A);	// pulse speaker +
	     _delay_us(CPO_HALF_CYCLE);	// 1/2 cycle
	     PORTA = (1 << SPKR_B);	// pulse speaker -
	     _delay_us(CPO_HALF_CYCLE);	// 1/2 cycle
	}
	else
	    PORTA = 0;			// no DC on speaker!
    }
}

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is that a powered speaker? I don't see a supply - internal battery? Driving a low impedance speaker directly would draw too much current. I'm thinking there's more to it than meets the eye.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ajcashin wrote:

Is that a powered speaker? I don't see a supply - internal battery? Driving a low impedance speaker directly would draw too much current. I'm thinking there's more to it than meets the eye.

5V wall wart not in the picture.  Was using clip leads for power, but have since soldered on a power jack (which the board is designed to take.)  Not a powered speaker - there's a 330 Ohm resistor in the circuit behind the speaker.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

kk6gm wrote:

ajcashin wrote:

 

Is that a powered speaker? I don't see a supply - internal battery? Driving a low impedance speaker directly would draw too much current. I'm thinking there's more to it than meets the eye.

5V wall wart not in the picture.  Was using clip leads for power, but have since soldered on a power jack (which the board is designed to take.)  Not a powered speaker - there's a 330 Ohm resistor in the circuit behind the speaker.

I figured as much. Good to complete the picture if someone else copied the idea. Nice hack.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could also build the Real Thing!

 

Morse Code Sounder

 

An ATmega328P driving an (open-collector) MPSA13.

 

--Mike

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Morse code is way to get complex information into an extremely simple basic AVR system when the only input/output that you have is a push-switch and an LED.

 

The Atmel Xpress boards come with a Morse code parser and generator as their demo program.  I'm still trying to convert it to Arduino.  Is Morse code still used for anything? besides prisoners tapping on drainpipes and  one button/one LED embedded systems?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:

Is Morse code still used for anything? besides prisoners tapping on drainpipes and  one button/one LED embedded systems?

Still used on the ham bands, fairly heavily.  My son says it is used in video games, and that's what got him interested - that surprised me.  And definitely useful for debugging.

 

Should also be extremely valuable when the zombie apocalypse comes.

Last Edited: Fri. Dec 21, 2018 - 02:26 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is Morse code still used for anything? besides prisoners tapping on drainpipes and  one button/one LED embedded systems?

I wonder how many vending machines have this hidden feature, where you can simply tap in "free candy" & then make your selection.  

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A friend of mine built a multi-strand cable tester that worked by sending a different Morse Code letter down each wire.  Clip up an earbud and listen to each one.

 

I have an AVR-driven gizmo that flashes my Xmas lights in Morse Code (using a 90s1200, of all things, and a relay.  (It ticks a lot.  An SSR or triac would have been better)).  The first season I put them up they said, "If you can read this send me email" and gave my email address.  Nobody did, so now I can make them say anything I like...  devil   (There's an RS-232 interface for programming the message).

 

-.- --. .. .. --     S.