/*! \file chipcon.c
\author Travis Goodspeed
-
- This is an implementation of the Chipcon 8051
- debugging protocol for the GoodFET.
+ \brief Chipcon 8051 debugging.
*/
//This could be more accurate.
//Does it ever need to be?
-#define CCSPEED 0
+#define CCSPEED 3
#define CCDELAY(x) delay(x)
#define SETMOSI P5OUT|=MOSI
//! Handles a monitor command.
void cchandle(unsigned char app,
unsigned char verb,
- unsigned char len){
+ unsigned long len){
switch(verb){
//CC_PEEK and CC_POKE will come later.
case READ: //Write a command and return 1-byte reply.
unsigned char c){
unsigned char cmd=0x54+(len&0x3);//(len&0x3);
CCWRITE;
+ cctrans8(0xFF);//resync
+ cctrans8(0xFF);//resync
+ cctrans8(0xFF);//resync
+ cctrans8(0xFF);//resync
+ cctrans8(0xFF);//resync
cctrans8(cmd);
if(len--)
cctrans8(a);