From 96bf694c533026d571e3fa567edc450ae8a1e24a Mon Sep 17 00:00:00 2001 From: travisutk Date: Sat, 25 Dec 2010 01:52:45 +0000 Subject: [PATCH 1/1] Some Chipcon devices have a resistor and capacitor on the !RST line. This slows down the init sequence, allowing stubborn devices to initialize. git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@812 12e2690d-a6be-4b82-a7b7-67c4a43b65c8 --- firmware/apps/chipcon/chipcon.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/firmware/apps/chipcon/chipcon.c b/firmware/apps/chipcon/chipcon.c index c189118..28bc52b 100644 --- a/firmware/apps/chipcon/chipcon.c +++ b/firmware/apps/chipcon/chipcon.c @@ -34,11 +34,12 @@ #define MISO BIT2 #define SCK BIT3 + //This could be more accurate. //Does it ever need to be? #define CCSPEED 3 -//#define CCDELAY(x) delay(x) -#define CCDELAY(x) +#define CCDELAY(x) delay(x) +//#define CCDELAY(x) #define SETMOSI P5OUT|=MOSI #define CLRMOSI P5OUT&=~MOSI @@ -82,14 +83,21 @@ void ccdebuginit(){ //Two positive debug clock pulses while !RST is low. //Take RST low, pulse twice, then high. P5OUT&=~SCK; + delay(10); P5OUT&=~RST; + delay(10); + //Two rising edges. P5OUT^=SCK; //up + delay(1); P5OUT^=SCK; //down + delay(1); P5OUT^=SCK; //up + delay(1); P5OUT^=SCK; //Unnecessary. - + delay(1); + //delay(0); //Raise !RST. P5OUT|=RST; -- 2.20.1