Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PE5PVB authored May 31, 2023
1 parent b9d52b0 commit aba24c0
Show file tree
Hide file tree
Showing 14 changed files with 4,818 additions and 0 deletions.
425 changes: 425 additions & 0 deletions TEF6686_ESP32-v116_RC/TEF6686.cpp

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions TEF6686_ESP32-v116_RC/TEF6686.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#define TEF6686_h

#include "Arduino.h"
#include "Tuner_Api.h"
#include "Tuner_Drv_Lithio.h"
#include "Tuner_Interface.h"


enum RDS_GROUPS
{
RDS_GROUP_0A, RDS_GROUP_0B, RDS_GROUP_1A, RDS_GROUP_1B, RDS_GROUP_2A, RDS_GROUP_2B, RDS_GROUP_3A, RDS_GROUP_3B,
RDS_GROUP_4A, RDS_GROUP_4B, RDS_GROUP_5A, RDS_GROUP_5B, RDS_GROUP_6A, RDS_GROUP_6B, RDS_GROUP_7A, RDS_GROUP_7B,
RDS_GROUP_8A, RDS_GROUP_8B, RDS_GROUP_9A, RDS_GROUP_9B, RDS_GROUP_10A, RDS_GROUP_10B, RDS_GROUP_11A, RDS_GROUP_11B,
RDS_GROUP_12A, RDS_GROUP_12B, RDS_GROUP_13A, RDS_GROUP_13B, RDS_GROUP_14A, RDS_GROUP_14B, RDS_GROUP_15A, RDS_GROUP_15B
};

typedef struct _rds_
{
char picode[5];
char stationName[9];
char stationText[65];
byte stationTypeCode;
char stationType[17];
uint16_t hours, minutes, days, offsetplusmin, stationID = 0, rdsA, rdsB, rdsC, rdsD, rdsError, errors = 0;
int8_t offset;
uint8_t stationTextOffset = 0;
bool hasCT = false;
bool rtAB = false;
} rds_;

class TEF6686 {
public:
rds_ rds;
bool readRDS(void);
uint16_t getFrequency();
uint16_t getFrequency_AM();
uint16_t tuneDown(uint8_t stepsize, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds);
uint16_t tuneUp(uint8_t stepsize, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds);
uint16_t tuneDown_AM(uint8_t stepsize);
uint16_t tuneUp_AM(uint8_t stepsize);
bool getStatus(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation);
bool getStatus_AM(int16_t &level, uint16_t &USN, uint16_t &WAM, int16_t &offset, uint16_t &bandwidth, uint16_t &modulation);
bool getIdentification(uint16_t &device, uint16_t &hw_version, uint16_t &sw_version);
bool getBootStatus(uint8_t &bootstatus);
void setMono(uint8_t mono);
bool getStereoStatus();
void init(byte TEF);
void clearRDS(bool fullsearchrds);
void power(uint8_t mode);
void setAGC(uint8_t start);
void setiMS(uint16_t mph);
void setEQ(uint16_t eq);
void setDeemphasis(uint8_t timeconstant);
void setFMABandw();
void setFMBandw(uint16_t bandwidth);
void setAMBandw(uint16_t bandwidth);
void setFrequency(uint16_t frequency, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds);
void setFrequency_AM(uint16_t frequency);
void setHighCutLevel(uint16_t limit);
void setHighCutOffset(uint16_t start);
void setMute();
void setOffset(int16_t offset);
void setStereoLevel(uint16_t start);
void setUnMute();
void setVolume(int16_t volume);
uint8_t af_counter;

private:
uint16_t tune(uint8_t up, uint8_t stepsize, uint16_t LowEdge, uint16_t HighEdge, bool fullsearchrds);
uint16_t tune_AM(uint8_t up, uint8_t stepsize);
uint8_t ascii_converter (uint8_t src);
uint8_t ps_process;
uint8_t rt_process;
char ps_buffer[9];
char rt_buffer[65];
bool ABold;
byte rt_timer;
byte offsetold;
char stationTextBuffer[65];
};
Loading

11 comments on commit aba24c0

@andimik
Copy link

@andimik andimik commented on aba24c0 May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note, that lines starting with S now have an additional leading R (examples filtered by grep R)

Re0104f45a20300
RSs71,2,36
RSs71,2,36
RSs71,2,36
R001f2739202000
RSs71,2,36
RSs71,2,36
RSs71,2,36
RSs71,2,36
R8001c196809200
RSs71,2,36
RSs71,2,36
RSs71,2,36
R0018e524202000
RSs71,2,36
RSs71,2,36
RSs71,2,36
Re0112033a20300
RSs71,2,36
RSs71,2,36
RSs71,2,36
R0019245c4f4500
RSs71,2,36

@PE5PVB
Copy link
Owner Author

@PE5PVB PE5PVB commented on aba24c0 May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should not happen. I'll look into it tomorrow.

@andimik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another issue: after connecting to xdr-gtk, sometimes the TEF display loses the bandwidth information (the value disappears). When you select another frequency, it turns to 0 kHz. Restart helps.

@PE5PVB
Copy link
Owner Author

@PE5PVB PE5PVB commented on aba24c0 May 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is reception stopped at that point?

@andimik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is reception stopped at that point?

Good question. Have to check.

I found another bug with Clock Time (CT). 0:13 next day is shown as 24:13 on the display. I found a station with wrong CT, but the TEF should not use hours >24.

grafik

grafik

@andimik
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And can you reset the RDS fields in case of PI and/or frequency change via xdr-gtk? Currently the old PS from previous frequency will remain until the new PS is detected. Same with RT, CT and PI.

@PE5PVB
Copy link
Owner Author

@PE5PVB PE5PVB commented on aba24c0 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

24 hour bug fixed.
About a reset to RDS Spy, this needs to be done by XDRGTK, I can't send a command directly to RDS Spy.
The question regarding an R before every line, I can't reproduce.

@andimik
Copy link

@andimik andimik commented on aba24c0 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, when I change the frequency on the TEF the RDS fields are cleared on the TEF display.

If I change the frequency through xdr-gtk then the RDS fields won't be cleared on the TEF display. It has nothing to do with Rdsspy or xdr-gtk.

Regarding R: There are still some S Lines without leading R, but the most S lines now start with RS.

How does your serial output looks like?

I have made some recordings yesterday, see

windytan/redsea#89 (comment)

@andimik
Copy link

@andimik andimik commented on aba24c0 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear that the line

https://github.com/PE5PVB/TEF6686_ESP32-Archive/blob/main/TEF6686_ESP32-v116_RC/TEF6686_ESP32-v116_RC.ino#L1389

should be in line 1401 (within the if), but I have not tested it.

@PE5PVB
Copy link
Owner Author

@PE5PVB PE5PVB commented on aba24c0 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Please check the released version at my new repository. https://github.com/PE5PVB/TEF6686_ESP32

@andimik
Copy link

@andimik andimik commented on aba24c0 Jun 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will test it on the weekend. The R Bug seems solved, as far as I can see in the source code.

Please sign in to comment.