Morse Code Tutor TFT Screen


David Nelson
 

be sure you have the + out of the audio amp to the plus pole
of the speaker. Sometimes this helps.  Dave  kc2ipx

On Tue, Jul 2, 2019 at 9:21 AM Ken KM4NFQ <km4nfq@...> wrote:
Hello Doug, and everyone,

I just fixed it, with the help of Tom, WB6B. Tom suggested that I go
into the Config > Tone menu and reset the 700MHz frequency. That did
the trick! I have uploaded a new video to the YouTube at:
https://www.youtube.com/watch?v=lWZZJJu5DxI
I have a box full of various size speakers, so I will different ones
to see what happens.
The current speaker is labeled 8 OHMS 0.25W, and it is ~55mm in
diameter (2.25 inches).

Regards,
Ken, KM4NFQ "Not Fully Qualified"

On Tue, Jul 2, 2019 at 8:56 AM Doug W <dougwilner@...> wrote:
>
> On Tue, Jul 2, 2019 at 06:04 AM, Ken KM4NFQ wrote:
>
> The Audio is extremely poor. The A10K Audio Volume Pot works. I can
> turn the volume up and down. But the Audio Output is just clicks and
> chirps. I have another PAM8403 that I can try.
>
> Ken,
> I have mine half apart and it isn't in front of me but I would start with basic troubleshooting first.  Get rid of you whole audio amp circuit.  If you have a little buzzer connect it right to pin PA2 and ground.  If you don't have a buzzer try your speaker.  If that works you know the problem is in your amp circuit.  If you still have the same problems at least you have eliminated one variable.
>




Ken KM4NFQ <km4nfq@...>
 

Hello David, and everyone,

I changed the speaker to a 28mm (1.125 inch) diameter small plastic
speaker (from an old toy) with no OHM or Watt rating printed on it. I
eliminated the display from blinking on and off by turning DOWN the
volume until the blinking stopped. I made yet another short clip and
uploaded it to the YouTube at:
https://www.youtube.com/watch?v=1h7vzMhK_jQ

The ref wire from the speaker is connected to the '+' (positive) and
the black wire from the speaker is connected to the '-' (negative).

The next step is to connect the Dual Lever Paddle jack to the circuit.

Regards,
Ken, KM4NFQ "Not Fully Qualified"

On Tue, Jul 2, 2019 at 9:29 AM David Nelson <kc2ipx@...> wrote:

be sure you have the + out of the audio amp to the plus pole
of the speaker. Sometimes this helps. Dave kc2ipx

On Tue, Jul 2, 2019 at 9:21 AM Ken KM4NFQ <km4nfq@...> wrote:

Hello Doug, and everyone,

I just fixed it, with the help of Tom, WB6B. Tom suggested that I go
into the Config > Tone menu and reset the 700MHz frequency. That did
the trick! I have uploaded a new video to the YouTube at:
https://www.youtube.com/watch?v=lWZZJJu5DxI
I have a box full of various size speakers, so I will different ones
to see what happens.
The current speaker is labeled 8 OHMS 0.25W, and it is ~55mm in
diameter (2.25 inches).

Regards,
Ken, KM4NFQ "Not Fully Qualified"

On Tue, Jul 2, 2019 at 8:56 AM Doug W <dougwilner@...> wrote:

On Tue, Jul 2, 2019 at 06:04 AM, Ken KM4NFQ wrote:

The Audio is extremely poor. The A10K Audio Volume Pot works. I can
turn the volume up and down. But the Audio Output is just clicks and
chirps. I have another PAM8403 that I can try.

Ken,
I have mine half apart and it isn't in front of me but I would start with basic troubleshooting first. Get rid of you whole audio amp circuit. If you have a little buzzer connect it right to pin PA2 and ground. If you don't have a buzzer try your speaker. If that works you know the problem is in your amp circuit. If you still have the same problems at least you have eliminated one variable.


jjpurdum
 

All:

I created a short video that shows how the MCT works. See:


I have some ideas on the issues mentioned below. See the comments below.

Jack, W8TEE

On Tuesday, July 2, 2019, 7:04:30 AM EDT, Ken KM4NFQ <km4nfq@...> wrote:


Greetings,

I have a very short video of my Work-In-Progress Morse Code Tutor V2
This is an unlisted video, meant for this group only, so please don't
share the URL with others outside the group.

These comments are meant to be constructive, so please don't get too defensive!

The MCT2 circuit is breadboarded. Blue Pill, programmed with Jack
W8TEE's software and an ST-LINK V2 dongle, 2.2 TFT 320x240 display,
Rotary Encoder, PAM8403 Mini Audio Module Amp, small speaker. Powered
with bench power supply. Display works. Audio is just clicks and
chirps.
Sounds like a bad board to me, or it could be hooked up incorrectly. The board is capable of stereo output, so check the wiring carefully. As the video shows, the audio is acceptable even with a small, inexpensive, speaker.

It took awhile to get the display working properly. Tom, WB6B was a
great help in getting that sorted out. I have been adding one thing at
a time to the circuit, getting it to work, then moving on to the next
item. Divide and conquer!

The Rotary Encoder works, except it is quite touchy, and wants to skip
over menu items. That may change when it gets bolted down to an
enclosure?
Not all encoders are the same. Some produce only one pulse per detent, others produce as many as 4. Also, you can trigger the encoder on RISING, FALLING, or CHANGE state changes. The CHANGE state will generate the most pulses per rotation. You might try different constants instead of CHANGE . Also, keep in mind that most encoders may need to be "debounced". Think of the encoder as a contact arm sliding along a road surface. When it hits a speed bump, it rises, makes contact with a pad above the road, and sends a pulse to the microcontroller. However, some contact arms "vibrate" after the initial pulse, sending a vibrating, false pulse chain to the processor. You can lessen this by adding a delay immediately after sensing the contact, using:

   delay(100L);

Note the letter 'L' at the end of the number. That's to make sure the compiler knows that the number is a long data type. If it continues to "bounce", increase the number. If it doesn't bounce, lower the number. You want the delay long enough to stop the bounce, but as short as possible so the user can't sense the delay.


The Audio is extremely poor. The A10K Audio Volume Pot works. I can
turn the volume up and down. But the Audio Output is just clicks and
chirps. I have another PAM8403 that I can try.
As shown in the video, mine works fine...can't be sure of the problem here.

When I first started the MCT, and chose Receive > Letters, it came out
at 65535 wpm! Those letters were zooming by. I was able to adjust it
down to +/- 20000 wpm in the Config menu, and after that, it was at 20
wpm. Maybe a default wpm other than 65535 wpm would be nice?
What's wrong with 65K wpm? When you first run the program, the EEPROM is "virgin"...it's never been written to before. Most chip manufacturers set all memory to 0xFFFF during production, as that's an easy value to test for. Of course, that is also 65K. If you haven't run the Config memory, why would you expect it to be some realistic value? If this bothers you, add these lines to EEPROM.CPP at line 134:

  if (wordsPerMinute > 90 || wordsPerMinute < 5) {
    wordsPerMinute = 15;
  }



The Blue Pill Reset Button works for stopping a choice. Pushing the
Rotary Encoder switch maybe works, sometimes?
There's no "sometimes" about it...it works, you're just not at a program point where the code can sense it. My guess is that you don't understand how the encoder is programmed. The reason is because I chose to use polling rather than interrupts for sensing switch closure. The difference is significant. My best example of the difference is to assume you're putting fire sensors into the Empire state building, 100 sensors per floor. Further assume that it take 1 second to "visit" a sensor, read it, and report back "No Fire" (0), or "Fire" (1). After all sensors are sampled on the 1st floor, it proceeds to sensor 1 on the 2nd floor. This goes on until the top floor is read, and then it starts over on the first floor. It does this until: 1) power is removed, 2) a reset is performed, or 3) a component fails. This is how polling works. The problem: Suppose you have crappy luck and just as you leave the first floor, a fire breaks out on the first floor. By the time you get back to the first floor, almost 3 hours have elapsed! You'd be amazed how PO'ed people get when they have to wade through 10 floors of fire to go to lunch.

Interrupts work differently. With interrupts, each sensor has the ability to send a message to the controller if a fire breaks out. The message from the sensor is read by an Interrupt Service Routine (ISR) and causes the processor to stop whatever it's doing and immediately service the ISR. Anyone who's raised a 2 year old knows how an ISR works. Interrupts means an almost instantaneous (i.e., 1 second delay) response to a fire.

I chose to use polling because they are easier to use and understand. Feel free to change this to ISR processing if you're unhappy with the response.

I would like to see a short clip of some other people's Morse Code
Tutor V2 builds if there are any? I remember someone mentioning that
the Audio was too loud? The clicks and chirps in the video are with
the volume turned all the way up! See my video I just posted. Good God, man, if the audio is too loud, turn down the volume!

I would really like to see a good working Morse Code Tutor V2. It is
an open source project, but not all of us builders (especially me) are
expert programmers.
I don't take kindly to that comment, because it already is "a good working Morse Code Tutor". It may not be exactly what you want, but that's why I made it Open Source. All of your complaints are either hardware related (i.e., the audio amp) or arise because you don't understand how the controller works (i.e., why did it come up at 65K wpm). Always remember: You can always shit-can an existing design, design your own circuit, and write your own code. That's the best way to get exactly what you want. For most people, however, it's easier to start with a working design, even if it doesn't fit your needs perfectly.

Regards,
Ken, KM4NFQ




Bruce Hall
 

Here is a short clip of my Morse Code Tutor.
 
I added code for the SD card reader so that you can listen to your favorite book.   
You can change the code speed as you listen.

- Bruce.


On Tue, Jul 2, 2019 at 7:04 AM Ken KM4NFQ <km4nfq@...> wrote:
Greetings,

I have a very short video of my Work-In-Progress Morse Code Tutor V2
up on the YouTube at https://www.youtube.com/watch?v=xtWGiHvwpt8
This is an unlisted video, meant for this group only, so please don't
share the URL with others outside the group.

These comments are meant to be constructive, so please don't get too defensive!

The MCT2 circuit is breadboarded. Blue Pill, programmed with Jack
W8TEE's software and an ST-LINK V2 dongle, 2.2 TFT 320x240 display,
Rotary Encoder, PAM8403 Mini Audio Module Amp, small speaker. Powered
with bench power supply. Display works. Audio is just clicks and
chirps.

It took awhile to get the display working properly. Tom, WB6B was a
great help in getting that sorted out. I have been adding one thing at
a time to the circuit, getting it to work, then moving on to the next
item. Divide and conquer!

The Rotary Encoder works, except it is quite touchy, and wants to skip
over menu items. That may change when it gets bolted down to an
enclosure?

The Audio is extremely poor. The A10K Audio Volume Pot works. I can
turn the volume up and down. But the Audio Output is just clicks and
chirps. I have another PAM8403 that I can try.

When I first started the MCT, and chose Receive > Letters, it came out
at 65535 wpm! Those letters were zooming by. I was able to adjust it
down to +/- 20000 wpm in the Config menu, and after that, it was at 20
wpm. Maybe a default wpm other than 65535 wpm would be nice?

The Blue Pill Reset Button works for stopping a choice. Pushing the
Rotary Encoder switch maybe works, sometimes?

I would like to see a short clip of some other people's Morse Code
Tutor V2 builds if there are any? I remember someone mentioning that
the Audio was too loud? The clicks and chirps in the video are with
the volume turned all the way up!

I would really like to see a good working Morse Code Tutor V2. It is
an open source project, but not all of us builders (especially me) are
expert programmers.

Regards,
Ken, KM4NFQ




Ken KM4NFQ <km4nfq@...>
 

Hello Jack, and everyone,

Thank you for the video of your 'good' Morse Code Tutor 2 working
'good'. That is what I wanted to see. It is the first one *I* have
seen. Also, thank you for the constructive comments. All of your
comments are part of the documentation of the project.

'Good' science is science that has results that are
reproducible/repeatable. Not all of us builders are programmers
(especially me), so what may seem obvious to a programmer, is not so
obvious to me. Making a project 'open source' does not make me more of
a programmer than I already am (I am a hobbyist computer programmer).

In the very beginning of my post, I said that the comments I made were
meant to be constructive. They ARE constructive! I am constructing a
Morse Code Tutor 2. These are some of the problems I am running into.
I do not feel that I should be AFRAID to share my Build Notes.

I am a beginner, and from I have read, this project is to encourage
beginners to learn the Morse Code. IF the Morse Code Tutor 2 is only
meant for professional programmers, and advanced builders, then DO NOT
say that it is meant for beginners!

Many professional C programmers that I am acquainted with (my XYL, for
one) feel that documentation is unnecessary. They say, read the source
code, that's all the documentation you need. Well, I have some news
for you: some of us need documentation other than the source code!

For that reason, some of us have been trying to put together some
semblance of rudimentary documentation at a GitHub repository:
https://github.com/TemporarilyOffline/MorseCodeTutor

There you will find, all in one place, source code, wiring diagrams,
and other hopefully helpful things that are meant to help a beginner,
who is interested in learning the Morse Code, and also interested in
building a 'good' working Morse Code Tutor 2 circuit to use as an aid
in learning the Morse code. From my own experiences, so far, building
a 'good' Morse Code Tutor 2 is NOT as easy as building a Morse Code
Tutor 1: https://www.youtube.com/watch?v=A5qQ7FWoIcU

I have published these videos at the YouTube about constructing a
Morse Code Tutor 2:
I finally got the TFT display to do something after days of wiring,
rewiring, programming the Blue Pill.
https://www.youtube.com/watch?v=yaZ9iIteBkM

Yesterday, I hooked up the Audio Amp, and a speaker and a Volume Pot.
It clicked and chirped. This morning I made some progress, and finally
got some decent sound to come out of the speaker. Read the
descriptions of the videos.
https://www.youtube.com/watch?v=xtWGiHvwpt8
https://www.youtube.com/watch?v=lWZZJJu5DxI
In this one, I got the display to stop blinking by turning DOWN the volume.
https://www.youtube.com/watch?v=1h7vzMhK_jQ

I will continue posting my Build Notes of the Morse Code Tutor 2, just
in case another 'beginner' finds them helpful. I do not believe that I
am the only one having any of these problems.

Once again, there is some help here:
https://github.com/TemporarilyOffline/MorseCodeTutor

72
Ken, KM4NFQ "Not Fully Qualified"


On Tue, Jul 2, 2019 at 9:57 AM jjpurdum via Groups.Io
<jjpurdum@...> wrote:

All:

I created a short video that shows how the MCT works. See:

https://youtu.be/B2Kp_lzoVh4

I have some ideas on the issues mentioned below. See the comments below.

Jack, W8TEE

On Tuesday, July 2, 2019, 7:04:30 AM EDT, Ken KM4NFQ <km4nfq@...> wrote:


Greetings,

I have a very short video of my Work-In-Progress Morse Code Tutor V2
up on the YouTube at https://www.youtube.com/watch?v=xtWGiHvwpt8
This is an unlisted video, meant for this group only, so please don't
share the URL with others outside the group.

These comments are meant to be constructive, so please don't get too defensive!

The MCT2 circuit is breadboarded. Blue Pill, programmed with Jack
W8TEE's software and an ST-LINK V2 dongle, 2.2 TFT 320x240 display,
Rotary Encoder, PAM8403 Mini Audio Module Amp, small speaker. Powered
with bench power supply. Display works. Audio is just clicks and
chirps.
Sounds like a bad board to me, or it could be hooked up incorrectly. The board is capable of stereo output, so check the wiring carefully. As the video shows, the audio is acceptable even with a small, inexpensive, speaker.

It took awhile to get the display working properly. Tom, WB6B was a
great help in getting that sorted out. I have been adding one thing at
a time to the circuit, getting it to work, then moving on to the next
item. Divide and conquer!

The Rotary Encoder works, except it is quite touchy, and wants to skip
over menu items. That may change when it gets bolted down to an
enclosure?
Not all encoders are the same. Some produce only one pulse per detent, others produce as many as 4. Also, you can trigger the encoder on RISING, FALLING, or CHANGE state changes. The CHANGE state will generate the most pulses per rotation. You might try different constants instead of CHANGE . Also, keep in mind that most encoders may need to be "debounced". Think of the encoder as a contact arm sliding along a road surface. When it hits a speed bump, it rises, makes contact with a pad above the road, and sends a pulse to the microcontroller. However, some contact arms "vibrate" after the initial pulse, sending a vibrating, false pulse chain to the processor. You can lessen this by adding a delay immediately after sensing the contact, using:

delay(100L);

Note the letter 'L' at the end of the number. That's to make sure the compiler knows that the number is a long data type. If it continues to "bounce", increase the number. If it doesn't bounce, lower the number. You want the delay long enough to stop the bounce, but as short as possible so the user can't sense the delay.


The Audio is extremely poor. The A10K Audio Volume Pot works. I can
turn the volume up and down. But the Audio Output is just clicks and
chirps. I have another PAM8403 that I can try.
As shown in the video, mine works fine...can't be sure of the problem here.

When I first started the MCT, and chose Receive > Letters, it came out
at 65535 wpm! Those letters were zooming by. I was able to adjust it
down to +/- 20000 wpm in the Config menu, and after that, it was at 20
wpm. Maybe a default wpm other than 65535 wpm would be nice?
What's wrong with 65K wpm? When you first run the program, the EEPROM is "virgin"...it's never been written to before. Most chip manufacturers set all memory to 0xFFFF during production, as that's an easy value to test for. Of course, that is also 65K. If you haven't run the Config memory, why would you expect it to be some realistic value? If this bothers you, add these lines to EEPROM.CPP at line 134:

if (wordsPerMinute > 90 || wordsPerMinute < 5) {
wordsPerMinute = 15;
}



The Blue Pill Reset Button works for stopping a choice. Pushing the
Rotary Encoder switch maybe works, sometimes?
There's no "sometimes" about it...it works, you're just not at a program point where the code can sense it. My guess is that you don't understand how the encoder is programmed. The reason is because I chose to use polling rather than interrupts for sensing switch closure. The difference is significant. My best example of the difference is to assume you're putting fire sensors into the Empire state building, 100 sensors per floor. Further assume that it take 1 second to "visit" a sensor, read it, and report back "No Fire" (0), or "Fire" (1). After all sensors are sampled on the 1st floor, it proceeds to sensor 1 on the 2nd floor. This goes on until the top floor is read, and then it starts over on the first floor. It does this until: 1) power is removed, 2) a reset is performed, or 3) a component fails. This is how polling works. The problem: Suppose you have crappy luck and just as you leave the first floor, a fire breaks out on the first floor. By the time you get back to the first floor, almost 3 hours have elapsed! You'd be amazed how PO'ed people get when they have to wade through 10 floors of fire to go to lunch.

Interrupts work differently. With interrupts, each sensor has the ability to send a message to the controller if a fire breaks out. The message from the sensor is read by an Interrupt Service Routine (ISR) and causes the processor to stop whatever it's doing and immediately service the ISR. Anyone who's raised a 2 year old knows how an ISR works. Interrupts means an almost instantaneous (i.e., 1 second delay) response to a fire.

I chose to use polling because they are easier to use and understand. Feel free to change this to ISR processing if you're unhappy with the response.

I would like to see a short clip of some other people's Morse Code
Tutor V2 builds if there are any? I remember someone mentioning that
the Audio was too loud? The clicks and chirps in the video are with
the volume turned all the way up! See my video I just posted. Good God, man, if the audio is too loud, turn down the volume!

I would really like to see a good working Morse Code Tutor V2. It is
an open source project, but not all of us builders (especially me) are
expert programmers.
I don't take kindly to that comment, because it already is "a good working Morse Code Tutor". It may not be exactly what you want, but that's why I made it Open Source. All of your complaints are either hardware related (i.e., the audio amp) or arise because you don't understand how the controller works (i.e., why did it come up at 65K wpm). Always remember: You can always shit-can an existing design, design your own circuit, and write your own code. That's the best way to get exactly what you want. For most people, however, it's easier to start with a working design, even if it doesn't fit your needs perfectly.

Regards,
Ken, KM4NFQ




jjpurdum
 

Ken:

I disagree with some of your comments. First, if you accept the MCT as it is, you don't need to be a programmer. If you don't like the way something works, ask your XYL to change it, or pay a professional programmer to do it. The code speed complaint arises because you didn't understand what was going on. Had you asked your XYL about it, I'll bet she could have given you an answer in less than 2 seconds.

Second, there is no documentation because the MCT is the basis for a chapter in my new Projects book being written with Al Peter, AC8GY. There are a lot more details there, and more were given at the FDIM presentation I did on the MCT last May. I only made the code and schematic available because a number of FDIM people asked for it.

Third, the comment you made which I highlighted in green is repeated in your last response:

            ...meant to help a beginner, who is interested in learning the Morse Code, and also interested in
            building a 'good' working Morse Code Tutor

I take offense because you're implying it wasn't "good" in the first place. Not correct. It is "good" for its intended purpose and does what I said it would do. Because its not exactly what you wanted and you were having problem wiring it does not mean it is not "good". Your judgement results from you not understanding 1) the binary number system, 2) how rotary encoders work, 3) the difference between polling and interrupt driven devices. Had you understood these things, there would likely have been no need for an MCT2.

Fourth, the comment:

    I finally got the TFT display to do something after days of wiring, rewiring, programming the Blue Pill.

Whose fault is that? It took me less than 30 minutes to wire the display and write the code from scratch. To make that as issue is simply bogus. What explains the difference between your "days of wiring, rewiring, programming" and my 30 minutes? My guess it is experience, so why is that my fault? If you connect things according to the schematic and compile the code, it will work...probably less than 30 minutes for most people because the code's already done. To me, the comment comes off as you struggled because of something I did or did not do. Simply not true.

Fifth, this comment:

    This morning I made some progress, and finally got some decent sound to come out of the speaker

This would have probably been more truthful had you explained how you got it to work. Indeed, my guess is it should have read:

    This morning I finally got some decent sound to come out of the speaker after I corrected my wiring mistakes.

Big difference how this comes across to the reader.

Like you said, these are not criticisms of your posts, just constructive comments. However, ungrateful comments like this makes one wonder if contributing to Open Source is even worth the effort.

Jack, W8TEE


On Tuesday, July 2, 2019, 11:08:54 AM EDT, Ken KM4NFQ <km4nfq@...> wrote:


Hello Jack, and everyone,

Thank you for the video of your 'good' Morse Code Tutor 2 working
'good'. That is what I wanted to see. It is the first one *I* have
seen. Also, thank you for the constructive comments. All of your
comments are part of the documentation of the project.

'Good' science is science that has results that are
reproducible/repeatable. Not all of us builders are programmers
(especially me), so what may seem obvious to a programmer, is not so
obvious to me. Making a project 'open source' does not make me more of
a programmer than I already am (I am a hobbyist computer programmer).

In the very beginning of my post, I said that the comments I made were
meant to be constructive.  They ARE constructive! I am constructing a
Morse Code Tutor 2. These are some of the problems I am running into.
I do not feel that I should be AFRAID to share my Build Notes.

I am a beginner, and from I have read, this project is to encourage
beginners to learn the Morse Code. IF the Morse Code Tutor 2 is only
meant for professional programmers, and advanced builders, then DO NOT
say that it is meant for beginners!

Many professional C programmers that I am acquainted with (my XYL, for
one) feel that documentation is unnecessary. They say, read the source
code, that's all the documentation you need. Well, I have some news
for you: some of us need documentation other than the source code!

For that reason, some of us have been trying to put together some
semblance of rudimentary documentation at a GitHub repository:
https://github.com/TemporarilyOffline/MorseCodeTutor

There you will find, all in one place, source code, wiring diagrams,
and other hopefully helpful things that are meant to help a beginner,
who is interested in learning the Morse Code, and also interested in
building a 'good' working Morse Code Tutor 2 circuit to use as an aid
in learning the Morse code. From my own experiences, so far, building
a 'good' Morse Code Tutor 2 is NOT as easy as building a Morse Code
Tutor 1: https://www.youtube.com/watch?v=A5qQ7FWoIcU

I have published these videos at the YouTube about constructing a
Morse Code Tutor 2:
I finally got the TFT display to do something after days of wiring,
rewiring, programming the Blue Pill.
https://www.youtube.com/watch?v=yaZ9iIteBkM

Yesterday, I hooked up the Audio Amp, and a speaker and a Volume Pot.
It clicked and chirped. This morning I made some progress, and finally
got some decent sound to come out of the speaker. Read the
descriptions of the videos.
https://www.youtube.com/watch?v=xtWGiHvwpt8
https://www.youtube.com/watch?v=lWZZJJu5DxI
In this one, I got the display to stop blinking by turning DOWN the volume.
https://www.youtube.com/watch?v=1h7vzMhK_jQ

I will continue posting my Build Notes of the Morse Code Tutor 2, just
in case another 'beginner' finds them helpful. I do not believe that I
am the only one having any of these problems.

Once again, there is some help here:
https://github.com/TemporarilyOffline/MorseCodeTutor

72
Ken, KM4NFQ "Not Fully Qualified"


On Tue, Jul 2, 2019 at 9:57 AM jjpurdum via Groups.Io
<jjpurdum=yahoo.com@groups.io> wrote:
>
> All:
>
> I created a short video that shows how the MCT works. See:
>
> https://youtu.be/B2Kp_lzoVh4
>
> I have some ideas on the issues mentioned below. See the comments below.
>
> Jack, W8TEE
>
> On Tuesday, July 2, 2019, 7:04:30 AM EDT, Ken KM4NFQ <km4nfq@...> wrote:
>
>
> Greetings,
>
> I have a very short video of my Work-In-Progress Morse Code Tutor V2
> up on the YouTube at https://www.youtube.com/watch?v=xtWGiHvwpt8
> This is an unlisted video, meant for this group only, so please don't
> share the URL with others outside the group.
>
> These comments are meant to be constructive, so please don't get too defensive!
>
> The MCT2 circuit is breadboarded. Blue Pill, programmed with Jack
> W8TEE's software and an ST-LINK V2 dongle, 2.2 TFT 320x240 display,
> Rotary Encoder, PAM8403 Mini Audio Module Amp, small speaker. Powered
> with bench power supply. Display works. Audio is just clicks and
> chirps.
> Sounds like a bad board to me, or it could be hooked up incorrectly. The board is capable of stereo output, so check the wiring carefully. As the video shows, the audio is acceptable even with a small, inexpensive, speaker.
>
> It took awhile to get the display working properly. Tom, WB6B was a
> great help in getting that sorted out. I have been adding one thing at
> a time to the circuit, getting it to work, then moving on to the next
> item. Divide and conquer!
>
> The Rotary Encoder works, except it is quite touchy, and wants to skip
> over menu items. That may change when it gets bolted down to an
> enclosure?
> Not all encoders are the same. Some produce only one pulse per detent, others produce as many as 4. Also, you can trigger the encoder on RISING, FALLING, or CHANGE state changes. The CHANGE state will generate the most pulses per rotation. You might try different constants instead of CHANGE . Also, keep in mind that most encoders may need to be "debounced". Think of the encoder as a contact arm sliding along a road surface. When it hits a speed bump, it rises, makes contact with a pad above the road, and sends a pulse to the microcontroller. However, some contact arms "vibrate" after the initial pulse, sending a vibrating, false pulse chain to the processor. You can lessen this by adding a delay immediately after sensing the contact, using:
>
>    delay(100L);
>
> Note the letter 'L' at the end of the number. That's to make sure the compiler knows that the number is a long data type. If it continues to "bounce", increase the number. If it doesn't bounce, lower the number. You want the delay long enough to stop the bounce, but as short as possible so the user can't sense the delay.
>
>
> The Audio is extremely poor. The A10K Audio Volume Pot works. I can
> turn the volume up and down. But the Audio Output is just clicks and
> chirps. I have another PAM8403 that I can try.
> As shown in the video, mine works fine...can't be sure of the problem here.
>
> When I first started the MCT, and chose Receive > Letters, it came out
> at 65535 wpm! Those letters were zooming by. I was able to adjust it
> down to +/- 20000 wpm in the Config menu, and after that, it was at 20
> wpm. Maybe a default wpm other than 65535 wpm would be nice?
> What's wrong with 65K wpm? When you first run the program, the EEPROM is "virgin"...it's never been written to before. Most chip manufacturers set all memory to 0xFFFF during production, as that's an easy value to test for. Of course, that is also 65K. If you haven't run the Config memory, why would you expect it to be some realistic value? If this bothers you, add these lines to EEPROM.CPP at line 134:
>
>  if (wordsPerMinute > 90 || wordsPerMinute < 5) {
>    wordsPerMinute = 15;
>  }
>
>
>
> The Blue Pill Reset Button works for stopping a choice. Pushing the
> Rotary Encoder switch maybe works, sometimes?
> There's no "sometimes" about it...it works, you're just not at a program point where the code can sense it. My guess is that you don't understand how the encoder is programmed. The reason is because I chose to use polling rather than interrupts for sensing switch closure. The difference is significant. My best example of the difference is to assume you're putting fire sensors into the Empire state building, 100 sensors per floor. Further assume that it take 1 second to "visit" a sensor, read it, and report back "No Fire" (0), or "Fire" (1). After all sensors are sampled on the 1st floor, it proceeds to sensor 1 on the 2nd floor. This goes on until the top floor is read, and then it starts over on the first floor. It does this until: 1) power is removed, 2) a reset is performed, or 3) a component fails. This is how polling works. The problem: Suppose you have crappy luck and just as you leave the first floor, a fire breaks out on the first floor. By the time you get back to the first floor, almost 3 hours have elapsed! You'd be amazed how PO'ed people get when they have to wade through 10 floors of fire to go to lunch.
>
> Interrupts work differently. With interrupts, each sensor has the ability to send a message to the controller if a fire breaks out. The message from the sensor is read by an Interrupt Service Routine (ISR) and causes the processor to stop whatever it's doing and immediately service the ISR. Anyone who's raised a 2 year old knows how an ISR works. Interrupts means an almost instantaneous (i.e., 1 second delay) response to a fire.
>
> I chose to use polling because they are easier to use and understand. Feel free to change this to ISR processing if you're unhappy with the response.
>
> I would like to see a short clip of some other people's Morse Code
> Tutor V2 builds if there are any? I remember someone mentioning that
> the Audio was too loud? The clicks and chirps in the video are with
> the volume turned all the way up! See my video I just posted. Good God, man, if the audio is too loud, turn down the volume!
>
> I would really like to see a good working Morse Code Tutor V2. It is
> an open source project, but not all of us builders (especially me) are
> expert programmers.
> I don't take kindly to that comment, because it already is "a good working Morse Code Tutor". It may not be exactly what you want, but that's why I made it Open Source. All of your complaints are either hardware related (i.e., the audio amp) or arise because you don't understand how the controller works (i.e., why did it come up at 65K wpm). Always remember: You can always shit-can an existing design, design your own circuit, and write your own code. That's the best way to get exactly what you want. For most people, however, it's easier to start with a working design, even if it doesn't fit your needs perfectly.
>
> Regards,
> Ken, KM4NFQ
>
>
>
>



Ken KM4NFQ <km4nfq@...>
 

Hello Jack, and everyone,

I would like to point people to a GitHub repository that has some hopefully helpful things for beginners who are trying to build the Morse Code Tutor 2 project:
https://github.com/TemporarilyOffline/MorseCodeTutor

I recently uploaded a .bin file of the MCT2 project (thanks Tom!) to the above site (in the bin directory). I used it to successfully flash the Blue Pill connected to a ST-LINK V2 using the st-flash utility from: https://github.com/texane/stlink

So if anyone is having problems programming their Blue Pill with the Arduino IDE, that might help? Since I use the Debian GNU/Linux system, I had to compile the source code for the utilities, but there are some pre-compiled binaries for other systems in the texane/stlink repository.

My next step is to connect the paddles to the project. I have made a pinout diagram of the 3.5mm stereo plug that I am using:

stereo-jack01.png

Regards,
Ken, KM4NFQ "Not Fully Qualified"



On Tue, Jul 2, 2019 at 12:02 PM jjpurdum via Groups.Io <jjpurdum=yahoo.com@groups.io> wrote:
Ken:

I disagree with some of your comments. First, if you accept the MCT as it is, you don't need to be a programmer. If you don't like the way something works, ask your XYL to change it, or pay a professional programmer to do it. The code speed complaint arises because you didn't understand what was going on. Had you asked your XYL about it, I'll bet she could have given you an answer in less than 2 seconds.

Second, there is no documentation because the MCT is the basis for a chapter in my new Projects book being written with Al Peter, AC8GY. There are a lot more details there, and more were given at the FDIM presentation I did on the MCT last May. I only made the code and schematic available because a number of FDIM people asked for it.

Third, the comment you made which I highlighted in green is repeated in your last response:

            ...meant to help a beginner, who is interested in learning the Morse Code, and also interested in
            building a 'good' working Morse Code Tutor

I take offense because you're implying it wasn't "good" in the first place. Not correct. It is "good" for its intended purpose and does what I said it would do. Because its not exactly what you wanted and you were having problem wiring it does not mean it is not "good". Your judgement results from you not understanding 1) the binary number system, 2) how rotary encoders work, 3) the difference between polling and interrupt driven devices. Had you understood these things, there would likely have been no need for an MCT2.

Fourth, the comment:

    I finally got the TFT display to do something after days of wiring, rewiring, programming the Blue Pill.

Whose fault is that? It took me less than 30 minutes to wire the display and write the code from scratch. To make that as issue is simply bogus. What explains the difference between your "days of wiring, rewiring, programming" and my 30 minutes? My guess it is experience, so why is that my fault? If you connect things according to the schematic and compile the code, it will work...probably less than 30 minutes for most people because the code's already done. To me, the comment comes off as you struggled because of something I did or did not do. Simply not true.

Fifth, this comment:

    This morning I made some progress, and finally got some decent sound to come out of the speaker

This would have probably been more truthful had you explained how you got it to work. Indeed, my guess is it should have read:

    This morning I finally got some decent sound to come out of the speaker after I corrected my wiring mistakes.

Big difference how this comes across to the reader.

Like you said, these are not criticisms of your posts, just constructive comments. However, ungrateful comments like this makes one wonder if contributing to Open Source is even worth the effort.

Jack, W8TEE


On Tuesday, July 2, 2019, 11:08:54 AM EDT, Ken KM4NFQ <km4nfq@...> wrote:


Hello Jack, and everyone,

Thank you for the video of your 'good' Morse Code Tutor 2 working
'good'. That is what I wanted to see. It is the first one *I* have
seen. Also, thank you for the constructive comments. All of your
comments are part of the documentation of the project.

'Good' science is science that has results that are
reproducible/repeatable. Not all of us builders are programmers
(especially me), so what may seem obvious to a programmer, is not so
obvious to me. Making a project 'open source' does not make me more of
a programmer than I already am (I am a hobbyist computer programmer).

In the very beginning of my post, I said that the comments I made were
meant to be constructive.  They ARE constructive! I am constructing a
Morse Code Tutor 2. These are some of the problems I am running into.
I do not feel that I should be AFRAID to share my Build Notes.

I am a beginner, and from I have read, this project is to encourage
beginners to learn the Morse Code. IF the Morse Code Tutor 2 is only
meant for professional programmers, and advanced builders, then DO NOT
say that it is meant for beginners!

Many professional C programmers that I am acquainted with (my XYL, for
one) feel that documentation is unnecessary. They say, read the source
code, that's all the documentation you need. Well, I have some news
for you: some of us need documentation other than the source code!

For that reason, some of us have been trying to put together some
semblance of rudimentary documentation at a GitHub repository:
https://github.com/TemporarilyOffline/MorseCodeTutor

There you will find, all in one place, source code, wiring diagrams,
and other hopefully helpful things that are meant to help a beginner,
who is interested in learning the Morse Code, and also interested in
building a 'good' working Morse Code Tutor 2 circuit to use as an aid
in learning the Morse code. From my own experiences, so far, building
a 'good' Morse Code Tutor 2 is NOT as easy as building a Morse Code
Tutor 1: https://www.youtube.com/watch?v=A5qQ7FWoIcU

I have published these videos at the YouTube about constructing a
Morse Code Tutor 2:
I finally got the TFT display to do something after days of wiring,
rewiring, programming the Blue Pill.
https://www.youtube.com/watch?v=yaZ9iIteBkM

Yesterday, I hooked up the Audio Amp, and a speaker and a Volume Pot.
It clicked and chirped. This morning I made some progress, and finally
got some decent sound to come out of the speaker. Read the
descriptions of the videos.
https://www.youtube.com/watch?v=xtWGiHvwpt8
https://www.youtube.com/watch?v=lWZZJJu5DxI
In this one, I got the display to stop blinking by turning DOWN the volume.
https://www.youtube.com/watch?v=1h7vzMhK_jQ

I will continue posting my Build Notes of the Morse Code Tutor 2, just
in case another 'beginner' finds them helpful. I do not believe that I
am the only one having any of these problems.

Once again, there is some help here:
https://github.com/TemporarilyOffline/MorseCodeTutor

72
Ken, KM4NFQ "Not Fully Qualified"


On Tue, Jul 2, 2019 at 9:57 AM jjpurdum via Groups.Io
<jjpurdum=yahoo.com@groups.io> wrote:
>
> All:
>
> I created a short video that shows how the MCT works. See:
>
> https://youtu.be/B2Kp_lzoVh4
>
> I have some ideas on the issues mentioned below. See the comments below.
>
> Jack, W8TEE
>
> On Tuesday, July 2, 2019, 7:04:30 AM EDT, Ken KM4NFQ <km4nfq@...> wrote:
>
>
> Greetings,
>
> I have a very short video of my Work-In-Progress Morse Code Tutor V2
> up on the YouTube at https://www.youtube.com/watch?v=xtWGiHvwpt8
> This is an unlisted video, meant for this group only, so please don't
> share the URL with others outside the group.
>
> These comments are meant to be constructive, so please don't get too defensive!
>
> The MCT2 circuit is breadboarded. Blue Pill, programmed with Jack
> W8TEE's software and an ST-LINK V2 dongle, 2.2 TFT 320x240 display,
> Rotary Encoder, PAM8403 Mini Audio Module Amp, small speaker. Powered
> with bench power supply. Display works. Audio is just clicks and
> chirps.
> Sounds like a bad board to me, or it could be hooked up incorrectly. The board is capable of stereo output, so check the wiring carefully. As the video shows, the audio is acceptable even with a small, inexpensive, speaker.
>
> It took awhile to get the display working properly. Tom, WB6B was a
> great help in getting that sorted out. I have been adding one thing at
> a time to the circuit, getting it to work, then moving on to the next
> item. Divide and conquer!
>
> The Rotary Encoder works, except it is quite touchy, and wants to skip
> over menu items. That may change when it gets bolted down to an
> enclosure?
> Not all encoders are the same. Some produce only one pulse per detent, others produce as many as 4. Also, you can trigger the encoder on RISING, FALLING, or CHANGE state changes. The CHANGE state will generate the most pulses per rotation. You might try different constants instead of CHANGE . Also, keep in mind that most encoders may need to be "debounced". Think of the encoder as a contact arm sliding along a road surface. When it hits a speed bump, it rises, makes contact with a pad above the road, and sends a pulse to the microcontroller. However, some contact arms "vibrate" after the initial pulse, sending a vibrating, false pulse chain to the processor. You can lessen this by adding a delay immediately after sensing the contact, using:
>
>    delay(100L);
>
> Note the letter 'L' at the end of the number. That's to make sure the compiler knows that the number is a long data type. If it continues to "bounce", increase the number. If it doesn't bounce, lower the number. You want the delay long enough to stop the bounce, but as short as possible so the user can't sense the delay.
>
>
> The Audio is extremely poor. The A10K Audio Volume Pot works. I can
> turn the volume up and down. But the Audio Output is just clicks and
> chirps. I have another PAM8403 that I can try.
> As shown in the video, mine works fine...can't be sure of the problem here.
>
> When I first started the MCT, and chose Receive > Letters, it came out
> at 65535 wpm! Those letters were zooming by. I was able to adjust it
> down to +/- 20000 wpm in the Config menu, and after that, it was at 20
> wpm. Maybe a default wpm other than 65535 wpm would be nice?
> What's wrong with 65K wpm? When you first run the program, the EEPROM is "virgin"...it's never been written to before. Most chip manufacturers set all memory to 0xFFFF during production, as that's an easy value to test for. Of course, that is also 65K. If you haven't run the Config memory, why would you expect it to be some realistic value? If this bothers you, add these lines to EEPROM.CPP at line 134:
>
>  if (wordsPerMinute > 90 || wordsPerMinute < 5) {
>    wordsPerMinute = 15;
>  }
>
>
>
> The Blue Pill Reset Button works for stopping a choice. Pushing the
> Rotary Encoder switch maybe works, sometimes?
> There's no "sometimes" about it...it works, you're just not at a program point where the code can sense it. My guess is that you don't understand how the encoder is programmed. The reason is because I chose to use polling rather than interrupts for sensing switch closure. The difference is significant. My best example of the difference is to assume you're putting fire sensors into the Empire state building, 100 sensors per floor. Further assume that it take 1 second to "visit" a sensor, read it, and report back "No Fire" (0), or "Fire" (1). After all sensors are sampled on the 1st floor, it proceeds to sensor 1 on the 2nd floor. This goes on until the top floor is read, and then it starts over on the first floor. It does this until: 1) power is removed, 2) a reset is performed, or 3) a component fails. This is how polling works. The problem: Suppose you have crappy luck and just as you leave the first floor, a fire breaks out on the first floor. By the time you get back to the first floor, almost 3 hours have elapsed! You'd be amazed how PO'ed people get when they have to wade through 10 floors of fire to go to lunch.
>
> Interrupts work differently. With interrupts, each sensor has the ability to send a message to the controller if a fire breaks out. The message from the sensor is read by an Interrupt Service Routine (ISR) and causes the processor to stop whatever it's doing and immediately service the ISR. Anyone who's raised a 2 year old knows how an ISR works. Interrupts means an almost instantaneous (i.e., 1 second delay) response to a fire.
>
> I chose to use polling because they are easier to use and understand. Feel free to change this to ISR processing if you're unhappy with the response.
>
> I would like to see a short clip of some other people's Morse Code
> Tutor V2 builds if there are any? I remember someone mentioning that
> the Audio was too loud? The clicks and chirps in the video are with
> the volume turned all the way up! See my video I just posted. Good God, man, if the audio is too loud, turn down the volume!
>
> I would really like to see a good working Morse Code Tutor V2. It is
> an open source project, but not all of us builders (especially me) are
> expert programmers.
> I don't take kindly to that comment, because it already is "a good working Morse Code Tutor". It may not be exactly what you want, but that's why I made it Open Source. All of your complaints are either hardware related (i.e., the audio amp) or arise because you don't understand how the controller works (i.e., why did it come up at 65K wpm). Always remember: You can always shit-can an existing design, design your own circuit, and write your own code. That's the best way to get exactly what you want. For most people, however, it's easier to start with a working design, even if it doesn't fit your needs perfectly.
>
> Regards,
> Ken, KM4NFQ
>
>
>
>



Tom, wb6b
 

I think it is great that Jack was willing to release this preview of his code and project before publishing his book. That implies that it may have not gone through many design/debug cycles based on internal and external "customer" testing. And there is no obligation for someone releasing something for free to do so.

It is also great that the people that the Code Tutor has captured their imagination to build are voluntarily creating documentation and relating their experiences to help others build the project. Rather than expect Jack to do it.

Even with professional projects I've been part of developing. It doesn't matter how much testing we have done ourselves (particularly on products with some internal complexity), the first test customer we give it to will do something we never though of and require things to be fixed. 

So it is fair that for Jack having released this project in a "preview" state, that we can return the favor with Alpha version and Beta version testing. Suggestions that will likely get filtered into his final published version an make it a better final project.

Good thing here is people have been taking the initiative to contribute and make the project easier to build for folks that may not desire to be as adventurous early adopters, rather than just finger pointing. 

I think this project in particular captures folks imagination because the Morse Code Tutor is something that is easy to see what it does and even most non-hams will likely get-it, why one would want to build one to learn or improve our code speed and learn additional things through constructing it. It is a project that is easy to envision ways one might want to branch off and change it. The complexity level, while non trivial, is within reach for hacking it. 

Tom, wb6b


David Shaw
 

To Jack W8TEE, and all those who contribute to the success of this group my heartfelt thanks.

I felt the need to personally thank you for your efforts as I am one of the, I think, many appreciative recipients of your hard work.

Please keep up the innovative and interesting ideas and projects, looking forward to the book.

73 Dave VK3DHF

 

_._,_._,_


jjpurdum
 

Dave:

Thanks for the kind words...they are sincerely appreciated. Truth be told, I over-reacted yesterday over some bad personal news and I let that spill into this forum. Not good.

Anyway, bear with me as there some super-cool stuff coming down the pike!

Jack, W8TEE

On Wednesday, July 3, 2019, 1:07:27 AM EDT, David Shaw <xsolar36@...> wrote:


To Jack W8TEE, and all those who contribute to the success of this group my heartfelt thanks.

I felt the need to personally thank you for your efforts as I am one of the, I think, many appreciative recipients of your hard work.

Please keep up the innovative and interesting ideas and projects, looking forward to the book.

73 Dave VK3DHF

 


jjpurdum
 

Hi Tom:

Also, thanks for taking the time to support my thoughts here. I probably did release the MCT too soon and it is difficult to anticipate all of the different ways something can be used "the wrong way" and write the code to minimize its impact. As I mentioned to Dave, a bad day yesterday caused me to over-react and I should not have let that spill onto this group. My bad. 

Again, the purpose of the MCT is to get more hams up and using code. It's not an easy sell, mainly because it does take effort to break down that wall that separates you from "learning CW" to "enjoying CW". Still, it is well-worth the effort. The good news is that a number of people have built the MCT and one group even did a club build of it and hope to teach classes using it. That makes it all worth it.

As to the book, Al (AC8GY) and I have refused several overtures to sign publishing contracts because we don't want a publisher cracking a "deadline whip" over our heads to get the book done. Instead, we will present a completed book to a publisher and only have to contend with the edit process. It's different from the Projects book in that it has projects that use the Arduino, Teensy, STM32F103 (Blue Pill), and the ESP32, not just the Arduino family. (We needed the extra resources horsepower on several of them.) All of these processors use patches to allow them to be programmed in the Arduino IDE. Al has created some truly unique stuff. He has a super-cool programmable bench power supply that should be really useful for the experimenter. It can do stuff like generating wave forms:

Inline image

that can be used to test circuits, but packages it in an attractive way:

Inline image

All of this is an attempt to get more hams involved with building their own "stuff". To make things easier on the reader, we already have an agreement for a distributor to sell the PCB's for the projects.

Alas, my EE abilities suck, but Al's a bloody genius at this stuff and it's easy to get his stuff published in almost any ham radio magazine. I just wish there was a publication, like "Software for Amateur Radio Experimenters" as I think there are a lot of people out there with really useful software hacks that could benefit all of us. Oh well...wrong place, wrong time.

Sorry for chewing up this much bandwidth, but I just wanted to clear the air about yesterday and let you know there's some pretty neat stuff around the corner...

Jack, W8TEE


On Tuesday, July 2, 2019, 11:45:11 PM EDT, Tom, wb6b <wb6b@...> wrote:


I think it is great that Jack was willing to release this preview of his code and project before publishing his book. That implies that it may have not gone through many design/debug cycles based on internal and external "customer" testing. And there is no obligation for someone releasing something for free to do so.

It is also great that the people that the Code Tutor has captured their imagination to build are voluntarily creating documentation and relating their experiences to help others build the project. Rather than expect Jack to do it.

Even with professional projects I've been part of developing. It doesn't matter how much testing we have done ourselves (particularly on products with some internal complexity), the first test customer we give it to will do something we never though of and require things to be fixed. 

So it is fair that for Jack having released this project in a "preview" state, that we can return the favor with Alpha version and Beta version testing. Suggestions that will likely get filtered into his final published version an make it a better final project.

Good thing here is people have been taking the initiative to contribute and make the project easier to build for folks that may not desire to be as adventurous early adopters, rather than just finger pointing. 

I think this project in particular captures folks imagination because the Morse Code Tutor is something that is easy to see what it does and even most non-hams will likely get-it, why one would want to build one to learn or improve our code speed and learn additional things through constructing it. It is a project that is easy to envision ways one might want to branch off and change it. The complexity level, while non trivial, is within reach for hacking it. 

Tom, wb6b