@@ -99,8 +99,8 @@ void setup_7800() {
99
99
DDRL = 0xFF ;
100
100
101
101
// Set Control Pins to Output
102
- // ---(PH0) CLK(PH1) ---(PH3) ---(PH4) ---(PH5) R/W(PH6)
103
- DDRH |= (1 << 0 ) | (1 << 1 ) | ( 1 << 3 ) | (1 << 4 ) | (1 << 5 ) | (1 << 6 );
102
+ // ---(PH0) ---(PH3) ---(PH4) ---(PH5) R/W(PH6)
103
+ DDRH |= (1 << 0 ) | (1 << 3 ) | (1 << 4 ) | (1 << 5 ) | (1 << 6 );
104
104
105
105
// Set TIME(PJ0) to Output (UNUSED)
106
106
DDRJ |= (1 << 0 );
@@ -109,8 +109,8 @@ void setup_7800() {
109
109
DDRC = 0x00 ;
110
110
111
111
// Setting Control Pins to HIGH
112
- // ---(PH0) CLK(PH1) ---(PH3) ---(PH4) ---(PH5) R/W(PH6)
113
- PORTH |= (1 << 0 ) | (1 << 1 ) | ( 1 << 3 ) | (1 << 4 ) | (1 << 5 ) | (1 << 6 );
112
+ // ---(PH0) ---(PH3) ---(PH4) ---(PH5) R/W(PH6)
113
+ PORTH |= (1 << 0 ) | (1 << 3 ) | (1 << 4 ) | (1 << 5 ) | (1 << 6 );
114
114
115
115
// Set Unused Data Pins (PA0-PA7) to Output
116
116
DDRA = 0xFF ;
@@ -120,6 +120,32 @@ void setup_7800() {
120
120
PORTL = 0xFF ; // A16-A23
121
121
PORTJ |= (1 << 0 ); // TIME(PJ0)
122
122
123
+ #ifdef clockgen_installed
124
+ // Adafruit Clock Generator
125
+
126
+ initializeClockOffset ();
127
+
128
+ if (!i2c_found) {
129
+ display_Clear ();
130
+ print_FatalError (F (" Clock Generator not found" ));
131
+ }
132
+
133
+ // Set Eeprom clock to 1Mhz
134
+ clockgen.set_freq (200000000ULL , SI5351_CLK1);
135
+
136
+ // Start outputting Eeprom clock
137
+ clockgen.output_enable (SI5351_CLK1, 1 ); // Eeprom clock
138
+
139
+ // Wait for clock generator
140
+ clockgen.update_status ();
141
+
142
+ #else
143
+ // Set CLK(PH1) to Output
144
+ DDRH |= (1 << 1 );
145
+ // Output a high signal CLK(PH1)
146
+ PORTH |= (1 << 1 );
147
+ #endif
148
+
123
149
checkStatus_7800 ();
124
150
strcpy (romName, " ATARI" );
125
151
0 commit comments