Re: Bus Pirate V4 external xtal
Reply #8 –
Sorry to be so late on this. I saw it several times when I managed wifi on my phone, but could not bring my self to tap out a message on the tiny keyboard (and it wouldn't make sense if I did because I'm so bad at it :D ).
**I was wrong on the BPv4 wiki and writeup. **
PIC clock is 12MHz, USB clock is 48MHz, core clock is 32MHz = 16MIPs with 2 clocks per cycle.
I wish I had a good excuse, but it was 11pm the night before the Tokyo trip and I was still finishing the writeup and I pulled the number out of the air instead of looking it up. My guess was based on other PICs.
18Fs need a 48MHZ clock for the USB. They get this by dividing the input clock (eg 20MHz) to get 4MHz (20MHz/5=4MHz) and then multiply 4MHz*24 to get 96MHz with a phase lock loop, then they divide that by 2 to get 48MHz. A PIC 18F has a 4cycle core so 48/4=12MIPS. Yes, it's unnecessarily complicated :D
I guessed - hey PIC crystal is 12MHz/3=4MHz*24=96MHz/2=48MHz. Then the processor speed was 48MHz/2=24MIPs. I actually knew this wasn't true when we wrote the draft, but I changed it in the late night edit because the math didn't make sense.
In reality the system clock is just handled by a whole other system. The actual speed is exactly the same as the v3, but more precise.
My apologies for the error and any frustration caused. In this case the design was solid, but my documentation fell a bit flat. I'll get it updated ASAP.