Netshroud Posted May 2, 2010 Posted May 2, 2010 http://www.hak5.org/projects/doku.php?id=psyduk Quote
Paul Stoffregen Posted May 22, 2010 Posted May 22, 2010 You need the set the clock prescaler at the beginning of your program, if you want anything other than the default of 2 MHz. All of the C examples I've published do this. Here's the safest code: int main(void) { CPU_PRESCALE(CPU_125kHz); _delay_ms(1); // allow slow power supply startup CPU_PRESCALE(CPU_16MHz); // set for 16 MHz clock //rest of your program You can also just immediately set it to 16 MHz if you're sure the power supply comes up quickly, but this tiny delay is much safer in the most extreme case where the CPU begins running before the power is all the way up to 5 volts. Here's some #defines you probably want to put in a header or someplace... #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define CPU_16MHz 0x00 #define CPU_8MHz 0x01 #define CPU_4MHz 0x02 #define CPU_2MHz 0x03 #define CPU_1MHz 0x04 #define CPU_500kHz 0x05 #define CPU_250kHz 0x06 #define CPU_125kHz 0x07 #define CPU_62kHz 0x08 Quote
Netshroud Posted May 23, 2010 Author Posted May 23, 2010 Thanks Paul, that fixed it. PsyDuk 0.3 is on the wiki, and PsyDuk is now on GitHub too. Quote
Netshroud Posted May 25, 2010 Author Posted May 25, 2010 Anyone have any idea why PDOpenLinuxRunBox is failing? At least it is on the Fedora 10 systems here, I haven't tested on my Mint/Ubuntu VMs at home. Alt+F4 and Alt+F2 (tested both) aren't working, and I'm confused. Quote
Netshroud Posted May 25, 2010 Author Posted May 25, 2010 Confirmed: They work in my Ubuntu/Mint VMs, but not on the Fedora 10 systems. :S Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.