/* * This file is part of the Bus Pirate project (buspirate.com). * * Originally written by hackaday.com * * To the extent possible under law, hackaday.com has * waived all copyright and related or neighboring rights to Bus Pirate. This * work is published from United States. * * For details see: http://creativecommons.org/publicdomain/zero/1.0/. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * */ //http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player #include "base.h" #include "jtag.h" _CONFIG2(FNOSC_FRCPLL & OSCIOFNC_ON &POSCMOD_NONE & I2C1SEL_PRI) // Internal FRC OSC = 8MHz _CONFIG1(JTAGEN_OFF & GCP_OFF & GWRP_OFF & COE_OFF & FWDTEN_OFF & ICS_PGx1) //turn off junk we don't need #pragma code //this loop services user input and passes it to be processed on int main(void){ CLKDIVbits.RCDIV0=0; //clock divider to 0 AD1PCFG = 0xFFFF; // Default all pins to digital OSCCONbits.SOSCEN=0; bpInit(); InitializeUART1(); //init the PC side serial port (needs bpInit() first for speed setting) BP_VREG_ON(); jtag(); while(1); //while }