MultiCLK Module for Atari 8-bit

Moderator: bbiernat

Post Reply
User avatar
pancio
Administrator
Posts: 67
Joined: 18 September 2013, 23:02 - Wed
Location: SILESIA

MultiCLK Module for Atari 8-bit

Post by pancio »

Hi Guys!

Introduction.
I would like to show you little different clock for your Atari... it's called Multi Clock Module and based on Si5351A programmable VCXO chip. The idea is to have all required frequencies on one board for all Atari models. How to do it? Si5351A has three independently clock generators which can be set to different frequency using I2C bus... so we need additional component like micro-controller in order to set proper frequency on each output channel. Schematic and PCB is very easy and anyone can make own device in home. I decided to use common module CJMCU-5351A instead Si5351A chip on my PCB because full equipped CJMCU-5351A (or clone) is cheaper than Si5351A! Strange but true.

This is the next project created as part of the activities of PTODT (Polskie Towarzystwo Ochrony Dziedzictwa Technicznego, which means the Polish Society for the Protection of Technical Heritage), founded for the protection of technical heritage, especially in the field of informatics and computers.

Project was made as Free Hardware under Creative Commons BY-NC-SA 4.0.This means - you can do it yourself, for private use. Commercial use is possible after obtaining the authors' consent.

Notice:
This device is still under development. Please read whole information carefully. If you plan to do device by your own hand, please use newest revision as possible.

Change log:
1. MultiCLKModule v1.0 - first issue, September 2024.
2. v1.0.1 - fixed swapped SDA/SCL lines on schematic/PCB design. October 2024.

PCB design
MultiCLK Module PCB top view
MultiCLK Module PCB top view
MCM1.png (177.23 KiB) Viewed 10985 times
MultiCLK Module PCB bottom view
MultiCLK Module PCB bottom view
MCM2.png (161.54 KiB) Viewed 10985 times
Code

The main code is very simply. Just need to set proper frequency and send parameters to Si5351A registers... Code is based on Peter Rachow (DK7IH) library wrote for Atmega8 and adapted for RISC-V CH32V003.

Code: Select all

/*
 /*
 * Example for using I2C with SI5351
 * 21-11-2023 PanciO
 */


#define SI5351_ADDRESS 0x60
#define SYSTEM_CORE_CLOCK 48000000
#define FUNCONF_SYSTEM_CORE_CLOCK 48000000
#define APB_CLOCK SYSTEM_CORE_CLOCK

#include "ch32v003fun.h"
#include <stdio.h>
#include "i2c.h"
#include "si5351.h"
#include <string.h>

#define WRITE   0
#define READ    1
int main()
{
	SystemInit();                       // 48MHz internal clock

    funGpioInitD();
    funPinMode( PD6, GPIO_Speed_10MHz | GPIO_CNF_OUT_PP );

    if(!i2c_init())                     // I2C init
    {
        unsigned long freq1 = 14187570;  //Atari XE XTAL clock  (PAL))
        //unsigned long freq1 = 16200000;  //Overclocked Atari XE XTAL clock, max: 16.2MHz)
        unsigned long freq2 = 3546895;   //Atari XL XTAL clock  (PAL)     
        //unsigned long freq2 = 3579545;  //Atari XL XTAL clock  (NTSC)
        unsigned long freq3 = 4433618;   //PAL

        i2c_init();
        si5351_start();                    
        si5351_set_freq(SYNTH_MS_0, freq1);
        si5351_set_freq(SYNTH_MS_1, freq2);
        si5351_set_freq(SYNTH_MS_2, freq3);
     }
     
 
    // main loop
	while(1)
	{
		funDigitalWrite( PD6, FUN_HIGH );
        Delay_Ms( 100 );
        funDigitalWrite( PD6, FUN_LOW );
	    Delay_Ms( 900 );
	}
   
}
   
 
Working prototype
A few days ago I received PCBs - looks nice... ready for assembly :-)
MCM1.0PCB.jpg
MCM1.0PCB.jpg (1.73 MiB) Viewed 8717 times
Assembled PCB:
MCMassembled1.jpeg
MCMassembled1.jpeg (1.46 MiB) Viewed 8717 times
MCMassembled2.jpeg
MCMassembled2.jpeg (1.59 MiB) Viewed 8717 times
As you can see in the pictures, it was necessary to use two cables that swap SDA and SCL. If you have PCB v1.0 - please remember to fix it! Version MCMv1.0.1 is free of this bug.

Results:
MCMmeasure.jpeg
MCMmeasure.jpeg (708.51 KiB) Viewed 8711 times
Main clock for Atari XE:
CLK0.png
CLK0.png (9.22 MiB) Viewed 8715 times
Main clock for XL:
CLK1.png
CLK1.png (9.2 MiB) Viewed 8715 times
PAL frequency:
CLK2.png
CLK2.png (9.22 MiB) Viewed 8715 times

All measured signals aren't under load. Let's test it with Atari...

Real test
I found working board, removed oscillator and connected to 1st Freddy's pin CLK0 (14.18xxMhz). When I plugged the power I saw red screen... I thought they didn't work but when I pushed reset system started up! So the conclusion I deduced is that the clock is started to slow or... too fast. I predicted such problems and added additional RESET signal to the board. Just need to be programmed,, soon!

Connected to Atari MCM...
MCMconnected.jpeg
MCMconnected.jpeg (927.52 KiB) Viewed 8629 times
Work space :-)
mess_on_table.jpeg
mess_on_table.jpeg (1.23 MiB) Viewed 8629 times
CLK0 is little different under load...
signal_under_freddie_load.png
signal_under_freddie_load.png (285.05 KiB) Viewed 8629 times
ToDo
1. I see some glitches on screen - don't know the reason - maybe wiring.. - need to test. - shorter wiring - problem solved.
2. Delayed reset after Power ON. - deleted Delay on the program beginning solved problem.
Attachments
i2c_si5351_NTSC.zip
(84.41 KiB) Downloaded 158 times
i2c_si5351_PAL.zip
(84.41 KiB) Downloaded 157 times
MultiClockModularV1.0.1.zip
(176.55 KiB) Downloaded 158 times
i2c_si5351A-A8CLKs.zip
(820.74 KiB) Downloaded 209 times

Post Reply