Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with playback on a real sid chip #21

Open
OzoneABN opened this issue Apr 3, 2023 · 7 comments
Open

Problems with playback on a real sid chip #21

OzoneABN opened this issue Apr 3, 2023 · 7 comments

Comments

@OzoneABN
Copy link

OzoneABN commented Apr 3, 2023

Hello,

I am having problems with playback on a real sid chip. Partly sounds are not played correctly or not at all. It seems to me that it is either timing problems between the Sid chip and the emulation or the 74HC595 have problems with the 3.3V signals of the ESP32. With many fast transfers it seems that the shift registers do not take over the values 100%. I used an external 1Mhz crystal for the circuit, I don't know if that causes problems with synchronization.

Have you had similar experiences? Can you give me any tips for the hardware setup?

Thanks a lot

@tobozo
Copy link
Collaborator

tobozo commented Apr 3, 2023

Hi, thanks for your feedback 👍

Can you please add precision to this post by adding the following information:

  • device type/version (esp32/wroom/s2/s3)
  • platform (arduino/platformio) + version
  • SID6581 library version
  • pinout (SID_CLOCK, SID_DATA, SID_LATCH, SID_PHI)
  • code snippet to reproduce
  • audio capture + song title (you can attach wav files to github posts)
  • picture of the build (optional)

Have you had similar experiences? Can you give me any tips for the hardware setup?

yes I've had similar experiences in different situations:

sid class misconfiguration

  • setting internal oscillator in sid.begin() when an external oscillator is used
  • bad core/priority assignation (see sid.setTaskCore() and sid.setTaskPriority)

Interesting functions you can play with:

void setTaskCore( BaseType_t uxCoreId ); // 0 or 1, default=0
void setTaskPriority( UBaseType_t uxPriority );  // 0..16, default=3
bool begin(int spi_clock_pin,int spi_data_pin, int latch ); // 1MHz from external oscillator
bool begin(int spi_clock_pin,int spi_data_pin, int latch,int sid_clock_pin); // 1MHz from ESP32 pin

platform misconfiguration

  • core not running at 240MHz
  • flash speed is not 80MHz

hardware misconfiguration

  • SID_PHI pin is connected to an ESP32 pin when an external oscillator is used
  • power chaining ESP32 vcc => buck converter 12v => SID produces precision loss when vcc can't supply at least 2A

For example the 1MHz oscillator I've tried in my first build with was consuming 500mA, which got the ESP32 to get out of sync and produce hilarious effects.

If possible, it's worth trying without the external oscillator, and use a pin from the ESP32 to generate that 1MHz signal.

@hpwit
Copy link
Owner

hpwit commented Apr 3, 2023

Hello
I have tried both with the 1Mhz and the clock signal coming from the esp32. Where did you source your 74hc595?
Rgds

@OzoneABN
Copy link
Author

OzoneABN commented Apr 3, 2023

Hello
I have tried both with the 1Mhz and the clock signal coming from the esp32. Where did you source your 74hc595?
Rgds

I ordered the chips from Reichelt, a German electronics retailer.

@OzoneABN
Copy link
Author

OzoneABN commented Apr 3, 2023

Hi, thanks for your feedback 👍

Can you please add precision to this post by adding the following information:

Thank you for your quick and detailed reply.

  • Device is an ESP-32 Dev Kit C V4 from AZ- Delivery
  • I used CLion with PlatformIO and the Arduino environment
  • I used the version 3.0.2-Beta
  • I used the standard PinOut SID_CLOCK Pin 18, SID_LATCH Pin 26 and SID_DATA Pin 23
  • I used the code from the newSIDPlayer.ino from the examples for testing

I still have one question about the SID_PHI signal from the ESP32: Doesn't that cause problems regarding 3.3V <-> 5V? Shouldn't I use a level shifter here?

I will test your tips in the next few days when I have time again.

Thanks again for the quick reply, I will get back to you regarding the results.

@tobozo
Copy link
Collaborator

tobozo commented Apr 3, 2023

3.0.2-Beta has only been tested on esp32-wrover and esp32-s3 without external oscillator, using output pins as SID_PHI.

I haven't tried with a level shifter though, and it was a SwinSID, not an reals MOS chip.

BTW I strongly recommend you play with a SID clone until you're sure everything is in order, swinsid clones are cheap enough to prevent a MOS sacrifice on the altar of SID research 😉

@hpwit
Copy link
Owner

hpwit commented Apr 3, 2023

You do not need a level shifter to go from the esp32 to the hc595 because 3.3 is above their activation level. And then they do output 5v hence perfect for the SID.

@hpwit
Copy link
Owner

hpwit commented Apr 4, 2023

Question is that a wrover or a wroom ? Because if it’s a wrover with psram you can’t use pins 17 and 18 as they are reserved for the psram ic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants