Re: How can I probe the 6502?
Posted: Sat Apr 10, 2021 5:06 pm
GARTHWILSON wrote:
...or at least buffer it with subsequent inverter section so the probes don't affect the frequency
Mark
Code: Select all
/***************************************************************************
* output 4-MHz clock on OC2A (D11/PB3) for SN76489AN sound chip demo' *
***************************************************************************/
void beginClock()
{ pinMode(11,OUTPUT); // OC2A (D11/PB3)
/* *
* TCCR2A settings for 'normal' or 'CTC' (non-PWM) mode *
* ------------------------------------------------------------ *
* COM2A1:COM2A0 '01' - Toggle OC2A on Compare Match *
* WGM22:WGM20 '010' - CTC mode (clear timer on compare match) *
* (WGM22 bit is in TCCR2B register) *
* */
TCCR2A = ((1 << WGM21) | (1 << COM2A0));
TCCR2B = (1 << CS20); // prescale = 1:1 (WGM22 = 0)
TIMSK2 = 0; // no interrupts
OCR2A = 1; // match value
} // 0/1/3/7 => 8/4/2/1 MHz
/***************************************************************************/