¿ªÔÆÌåÓý

Re: W8TEE Corrected Code Rel 3


Jack Purdum
 

I think I mentioned the fix earlier, but the change is in DoMenuSelect(). ?In the switch/case statement block, paste this code:? ??

case ENCODERTUNING:
? ? ? encoderMode = ENCODERTUNING;
? ? ? if (fasttuneStart - fasttuneEnd <= DEFAULTTRIGGER) { ? ?// They're spinning fast...
? ? ? ? currentFrequencyIncrement = FASTINCREMENT;
? ? ? } else {
? ? ? ? currentFrequencyIncrement = DEFAULTINCREMENT;
? ? ? }
? ? ? fasttuneEnd = fasttuneStart;
? ? ? fasttuneStart = 0UL; ??
? ? ? currentFrequency += (currentFrequencyIncrement * encoderDirection); ? ?// because CCW = -1 and CW = 1
? ? ? encoderDirection = 0;
? ? ? DoRangeCheck();
? ? ? sendFrequency(currentFrequency); ? ? ?// Send frequency to chip
? ? ? ShowFrequency(currentFrequency, 0); ? // Update display
? ? ? break;

You'll notice I also replaced some SDC (Sorta Dumb Code) that removes a redundant if?statement block. Let me know if this fixes your problem. I'm hoping to get 1.06 out this weekend.

Jack, W8TEE




From: Art Olson <olson339@...>
To: [email protected]
Sent: Saturday, August 12, 2017 10:11 AM
Subject: Re: [BITX20] W8TEE Corrected Code Rel 3

Jack

So my issue is a bit different. I can load and run ver 1.05. The encoder functions as the freq changes on the display. There is a sine wave via my scope from vfo out. However the freq readout on my scope never changes. ?This is the same version I sent you the other day

If I reload ver 1.03 everything works correctly. I have looked at the sketch and unable to find a reason for the anomaly.?

Art

Sent from my iPhone

On Aug 12, 2017, at 9:55 AM, Jack Purdum via Groups.Io <econjack@...> wrote:

It seems that the DDS output frequency issue only occurs at startup, before the encoder is rotated for the first time. Since that is the issue, the best place to put the "extra" sendFrequency() call is in setup(). ?If the call is in loop(), it will make unnecessary calls to sendFrequency() any time there's a 10 second interval while tuning. It's not going to "hurt" anything as written below, but other than the first time it's called, it's unnecessary. ?If others are having a different experience with it, please let me know.

Jack, W8TEE

From: Guido Charita <g.charita@...>
To: [email protected]
Sent: Saturday, August 12, 2017 3:20 AM
Subject: Re: [BITX20] W8TEE Corrected Code Rel 3

Hi all,

For the issue "DDS output frequency not changing" I added in the block void loop()
an extra line:?
sendFrequency(currentFrequency);
?
so in total this part looks like? (line number 1217):
?
if (currentFrequency != oldFreq) {????????????????????????? // Has the frequency changed?
?
??? sendFrequency(currentFrequency);
?
??? currentTune = millis();?????????????????????????????????? // Yep, but how long ago?
??? if (currentTune - oldTune > EEPROMUPDATEDELAY) {????????? // If greater than 10 seconds...
????? writeEEPROMParameter(READEEPROMFREQ, currentFrequency); // ...blast it to EEPROM
????? oldTune = currentTune;
????? oldFreq = currentFrequency;
??? }
?
73
guido? on7ch

On Fri, Aug 11, 2017 at 9:49 PM, Jack Purdum via Groups.Io <econjack@...> wrote:
There is a release 1.05 and a release 1.06 will likely be coming out early next week. Also, it appears that there needs to be two identical calls in setup() to sendFrequency(); one to clear the registers and one to actually set the frequency:

? encoderMode = ENCODERTUNING; ? ? ? ? ? ? ? ?// tuning
? sendFrequency( currentFrequency); ? ? ? ? ? ?// Appears we need to send it twice to clear the registers
? sendFrequency( currentFrequency);
? ShowFrequency( currentFrequency, 0);
? StartupScreen();

Jack, W8TEE

From: Guido Charita <g.charita@...>
To: [email protected]
Sent: Friday, August 11, 2017 3:00 PM
Subject: Re: [BITX20] W8TEE Corrected Code Rel 3

?
Hi,
?
Trying to get the VFO going, I saw that the DDS output frequency is not changing when turning the rotary encoder.

Only at startup the DDS output is set to the frequency memorized in the EEPROM.
Can somebody help to solve this (software) problem.

I have tried several DDS modules.
I see no pulses on pins 51, 52 & 53 on the 2560_MINI board when rotating the encoder.
?
I use B40SoftwareRel0105.
?
73
Guido? ON7CH
?



On Sat, Jul 22, 2017 at 3:40 AM, Jack Purdum via Groups.Io <econjack@...> wrote:
All:

I've been working with Art and finally have the code working. I was debugging and got careless and sent the wrong file out for use. This is complicated by the fact that my DDS just died. No smoke...no fanfare...just an aneurysm or else something internal. As most of you know, getting a Type II AD9850 isn't easy, but I have 3 coming to me as quickly as possible. Meanwhile, I've attached the *.ino file; the MorseCode.h file is okay.

Sorry for the hassles...

Jack, W8TEE




From: David S via Groups.Io <dcsuk10=[email protected]>
To: [email protected]
Sent: Friday, July 21, 2017 7:14 PM
Subject: Re: [BITX20] W8TEE Assembly Manual and Code Update

Art

Jack's changed the routine that drives the DDS, he's no longer using the library, if you want to test using the new code with the DDS running here's what you need to do.

Towards the top of the code you will find this line
//========================== Symbolic Constants ============================== ===========================
#define MYCALIBRATIONCONSTANT ? ? 125001066.3102821 ? // See manual

Inset this line?
#define BFOFREQUENCY ? ? ? ? ?11998000UL

Search for the following "void sendFrequency"

You should find this routine....

void sendFrequency(int32_t frequency)?
{
? ? uint32_t freq = ?frequency;
? ??
? ? for (int b = 0; b < 4; b++, freq >>= 8) {
? ? ? tfr_byte(freq & 0xFF);
? ? }
? ? tfr_byte(0x000); ? // Final control byte, all 0 for 9850 chip
? ? pulseHigh(FQ_UD); ?// Done!? Should see output
}
?
Comment out the whole routine and replace with this code

void sendFrequency(int32_t frequency) {
?
? DDS.setfreq( (float) BFOFREQUENCY - frequency, 0); ? // Second argument is phase. See library docs
? delay(10); ? ? ? ? ? ? ? ? ? ? ? ? ? ?// wait for AD9850 output to become stable
}

Be sure you don't miss the end bracket, this will revert to using the library and allow you to continue to test until Jack and make the required changes.? The first version of the code sets the VFO to the TX frequency, this modification will set the VFO to the actual required frequency 4.979 (ish) for 7.030 on the display.? Hope that helps.

Jack?

I can't see any pin defined for the Smeter or where the pin voltage would be picked up in the code.

David ?G8DJM



Virus-free.








Join [email protected] to automatically receive all group messages.