Author Topic: Is HLF brand legit?  (Read 3260 times)

0 Members and 1 Guest are viewing this topic.

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Is HLF brand legit?
« on: July 05, 2022, 03:48:45 pm »
Hello
I created this custom stereo digital volume control  that I hooked to my stm32 black pill, but I'm struggling to make it work! I wrote my bare metal I2C driver, which works with other I2c peripherals, but not with this one. As a matter of fact, I get no I2C activity on my oscilloscope (Both SDA and SCL line stay high). I think that the HLF PT2258 is fake, because I soon I plug an audio source, I get a sound output, but no attenuation!
Do you think that this brand is legit ? Do you have any previous experience with this brand?
Thanks in advance

« Last Edit: July 05, 2022, 03:50:19 pm by kgavionics »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Is HLF brand legit?
« Reply #1 on: July 05, 2022, 06:16:58 pm »
The reference is legit, but the vendor doesn't seem to be. The original part: http://www.princeton.com.tw/en-us/products/multimediaaudioic/electronicvolumecontroller.aspx
(PTC)

You probably got this part from Aliexpress or the like. Who knows what this part really is then.

I suppose you have the above datasheet and followed it?
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16860
  • Country: lv
Re: Is HLF brand legit?
« Reply #2 on: July 05, 2022, 06:26:13 pm »
It's made by Shenzhen honglifa Electronics, have no idea how good of a clone it is. However if it was an outright fake, you would get no audio output at all.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16860
  • Country: lv
Re: Is HLF brand legit?
« Reply #3 on: July 05, 2022, 06:38:36 pm »
Also code2 and code2 pins must be properly connected according to how you address the chip. And your soldering and PCB are dodgy enough that you cannot be sure that pins make a proper electrical contact. I would not suspect the chip as the main possible culprit considering how dodgy your implementation is. None of decoupling capacitors are used either.
« Last Edit: July 05, 2022, 06:40:54 pm by wraper »
 

Offline 8goran8

  • Contributor
  • Posts: 29
  • Country: cs
Re: Is HLF brand legit?
« Reply #4 on: July 05, 2022, 06:53:03 pm »
What is your PT2258 power supply voltage? Which pins are you using for i2c?
« Last Edit: July 05, 2022, 07:00:31 pm by 8goran8 »
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #5 on: July 05, 2022, 07:01:51 pm »
All the connections where tested and are good, so maybe the pcb doesn't look good, but should work!
Regarding the decoupling cap it's there .On top of that a decoupling cap is not gonna prevent the circuit from working.Furthermore, the circuit was build on bread board and it's not working either.
The circuit is 5v  powered.
I forgot to mention that I followed the schematic on the datasheet and the IC address is 88H.
I'm using Pin 6 and 7 ( SDA and SCL).
« Last Edit: July 05, 2022, 07:07:09 pm by kgavionics »
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16860
  • Country: lv
Re: Is HLF brand legit?
« Reply #6 on: July 05, 2022, 07:05:20 pm »
Regarding the decoupling cap it's there .On top of that a decoupling cap is not gonna prevent the circuit from working.
Unless it's on the bottom side, there is none. Saying that a quite fast digital circuit should work without a decoupling cap is quite optimistic. It could, but far from guaranteed.
« Last Edit: July 05, 2022, 07:07:21 pm by wraper »
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #7 on: July 05, 2022, 07:13:45 pm »
You think 100khz is fast?
 

Offline 8goran8

  • Contributor
  • Posts: 29
  • Country: cs
Re: Is HLF brand legit?
« Reply #8 on: July 05, 2022, 07:33:02 pm »
Have you complied with the i2c bus initialization time of at least 200-300ms?

"After Power is turned ON, PT2258 needs to wait for a short time in order to insure stability. The waiting
time period for PT2258 to send I 2 C Bus Signal is at least 200ms. If the waiting time period is less than
200ms, I 2 C Control may fail."
 
The following users thanked this post: kgavionics, SiliconWizard

Offline wraper

  • Supporter
  • ****
  • Posts: 16860
  • Country: lv
Re: Is HLF brand legit?
« Reply #9 on: July 05, 2022, 07:33:29 pm »
You think 100khz is fast?
Square wave has rise/fall times way faster than 100kHz frequency of I2C, which is not slow either.
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #10 on: July 05, 2022, 08:06:40 pm »
Have you complied with the i2c bus initialization time of at least 200-300ms?

"After Power is turned ON, PT2258 needs to wait for a short time in order to insure stability. The waiting
time period for PT2258 to send I 2 C Bus Signal is at least 200ms. If the waiting time period is less than
200ms, I 2 C Control may fail."
yes, I did !
By the way, this is my code:
Code: [Select]
#include<stm32f401xc.h>
#define SLAVE_ADDR 0x88   
#define PT2258_CMD_RESET 0xc0
#define PT2258_CMD_UNMUTE 0xf8
#define PT2258_CMD_MUTE 0xf9



void delay_ms(uint16_t t);

void I2C1_init(void);
int pt2258_send_att(char saddr, char byte1, char byte2);
int pt2258_command(char saddr, char command);

int main(void)

{

    I2C1_init();
    delay_ms(300); // delay after power on to allow pt2258 to initialize properly
    pt2258_command(SLAVE_ADDR,PT2258_CMD_RESET ); // 0XC0 IS A COMMAND TO CLEAR THE INTERNAL PT2258 REGISTER
    pt2258_send_att(SLAVE_ADDR,0x84,0x80); // Send -40 dB attenuation to channel 1
   pt2258_send_att(SLAVE_ADDR,0x44,0x80); // Send -40  dB attenuation to channel 2

    while(1)
    {

    }
}

This is the pt2258 board schematic:
« Last Edit: July 05, 2022, 08:14:32 pm by kgavionics »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Is HLF brand legit?
« Reply #11 on: July 05, 2022, 08:09:43 pm »
Now that reminds me of another post? Do I remember right?

Was this chip not requiring that you send the attenuation in 2 successive commands, one for a 10dB-step value and one for a 1dB-step value? Was it this chip?
If so, I do remember this point. You apparently are not sending both values for each channel, so the chip doesn't take the change into account.
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #12 on: July 05, 2022, 08:21:06 pm »
Now that reminds me of another post? Do I remember right?

Was this chip not requiring that you send the attenuation in 2 successive commands, one for a 10dB-step value and one for a 1dB-step value? Was it this chip?
If so, I do remember this point. You apparently are not sending both values for each channel, so the chip doesn't take the change into account.
   pt2258_send_att(SLAVE_ADDR,0x84,0x80); // Send -40 dB attenuation to channel 1
You're right man! But I'm sending -40 dB in the first byte which is 0x84 then I'm sending a 0 dB  (0x80) in the second byte  then I'm sending a stop bit. See attached image
According to datasheet, there's no command to send an attenuation value to more than one channel in the same time (except mute command), so you have to send the attenuation separately to each channel.
« Last Edit: July 05, 2022, 08:25:56 pm by kgavionics »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Is HLF brand legit?
« Reply #13 on: July 05, 2022, 08:32:04 pm »
OK, so that was "hidden" in your pt2258_send_att() function.

Can you try the "MUTE" command - which should mute all channels - to see if the chip reacts at all to the commands you send?

Ideally, if you have a scope, you should take a look at the I2C signals and see what happens on the bus. In particular, whether the chip does acknowledge anything you send.
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #14 on: July 05, 2022, 08:39:48 pm »
OK, so that was "hidden" in your pt2258_send_att() function.

Can you try the "MUTE" command - which should mute all channels - to see if the chip reacts at all to the commands you send?
I already tried that, but It didn't work!
what surprises me, that the board it's outputting sound even  if I disconnect the SCL and SDA lines! It's like there is no I2C communication at all between the MCU and the PT2258. I even checked single connection on the board and I didn't find any fault! On top of that, the I2C driver code it's working with the other I2C peripherals (with a little modification of course)  , like the PCF8574 IC.
I'm going to hook my scope again and see what's going on!
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Is HLF brand legit?
« Reply #15 on: July 05, 2022, 08:44:39 pm »
Double-check the I2C address. It's sometimes confusing depending on what you're using for driving I2C (a vendor library, your own access to registers, ...) It's a 7-bit address but that needs to be left-shifted, and then add the R/W bit in position 0. Might be obvious to you, but that's a common issue.

 

Offline 8goran8

  • Contributor
  • Posts: 29
  • Country: cs
Re: Is HLF brand legit?
« Reply #16 on: July 05, 2022, 08:52:09 pm »
I'm going to hook my scope again and see what's going on!

Please, check bus activity on your scope regarding PT2258 power on. Maybe your delay_ms routine is not good.
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #17 on: July 05, 2022, 11:07:49 pm »
This is the signal I got! It looks weird to me. I sent 0x88 address, but it looks like is 0x10 according to the screenshot( shot right after startup or reset state) !
Honestly, I have no clue, why I'm getting this!!
The delay routine is not the culprit, because I increased the delay up to 2s and I have still the same issue!
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Is HLF brand legit?
« Reply #18 on: July 06, 2022, 03:26:47 am »
Apparently the no legit thing is the piece behind the solder  :-DD
 

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #19 on: July 06, 2022, 10:52:35 am »
If you are trying to be funny,you're  not!
As I said before, the PCB doesn't look good because, it was made for fast prototyping purpose,but the finl product will be different!
Furthermore, every single connection was tested and it's good! Do you understand that?
« Last Edit: July 06, 2022, 10:54:46 am by kgavionics »
 

Offline 8goran8

  • Contributor
  • Posts: 29
  • Country: cs
Re: Is HLF brand legit?
« Reply #20 on: July 06, 2022, 12:18:30 pm »
Can you post the code for I2C1_init()?
I think the pt2258 address is not written correctly in the OAR1 register.
 
The following users thanked this post: kgavionics

Online newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Is HLF brand legit?
« Reply #21 on: July 06, 2022, 12:34:16 pm »
This is the signal I got! It looks weird to me. I sent 0x88 address, but it looks like is 0x10 according to the screenshot
Then try sending 0x44 as address - 0x10 looks very much like 0x88 << 1, doesn't it?

Heed the advice that SiliconWizard provided!
Double-check the I2C address. It's sometimes confusing depending on what you're using for driving I2C (a vendor library, your own access to registers, ...) It's a 7-bit address but that needs to be left-shifted, and then add the R/W bit in position 0. Might be obvious to you, but that's a common issue.
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: kgavionics

Offline kgavionicsTopic starter

  • Regular Contributor
  • *
  • Posts: 195
  • Country: ca
Re: Is HLF brand legit?
« Reply #22 on: July 06, 2022, 07:34:20 pm »
This is the signal I got! It looks weird to me. I sent 0x88 address, but it looks like is 0x10 according to the screenshot
Then try sending 0x44 as address - 0x10 looks very much like 0x88 << 1, doesn't it?

Heed the advice that SiliconWizard provided!

As it may sound weird, sending the address to 0x44, got the circuit working (the IC address is still 0x88). I have no idea why it's happening yet, though!
Thank you very much newbrain for the trick! but I have to figure out why this is happening, because it's only happening for the address, not the data!
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: Is HLF brand legit?
« Reply #23 on: July 06, 2022, 07:43:41 pm »
You need to show us the code that handles the I2C peripheral. It probably shifts the I2C address by 1, as I hinted earlier, since I2C addresses are 7-bit but the actual transmitted *byte* is the address (MSb first) and the R/W bit.

And glad you got it to work.
 
The following users thanked this post: kgavionics

Offline gamalot

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: au
  • Correct my English
    • Youtube
Re: Is HLF brand legit?
« Reply #24 on: July 06, 2022, 07:53:04 pm »


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf