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
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 );
}
}
A few days ago I received PCBs - looks nice... ready for assembly
Assembled PCB: 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 has free of this bug.
Results:
Main clock for Atari XE: Main clock for XL: PAL frequency:
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... Work space CLK0 is little different under load... 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.