From cc0495b7028f4b1189a00707d828a68534d1dea2 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 6 Mar 2009 22:52:35 -0800 Subject: Wait for a while when switching the RESET_N line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cc1111 manual suggests placing a 2.7kΩ resister and 1nF capacitor on the RESET_N line to filter out noise. This increases the time necessary to reset the chip to several microseconds which is longer than the interval between two USB packets. Flush the USB packet queue and sleep for a while after changing the value on the RESET_N line to make sure the chip sees the state change. Signed-off-by: Keith Packard --- lib/ccdbg-command.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/ccdbg-command.c') diff --git a/lib/ccdbg-command.c b/lib/ccdbg-command.c index d99e8ff3..74313bdf 100644 --- a/lib/ccdbg-command.c +++ b/lib/ccdbg-command.c @@ -27,11 +27,12 @@ ccdbg_debug_mode(struct ccdbg *dbg) ccdbg_debug(CC_DEBUG_COMMAND, "#\n"); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA|CC_RESET_N); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_DATA ); + ccdbg_wait_reset(dbg); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA ); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_DATA ); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA ); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_DATA|CC_RESET_N); - ccdbg_sync_io(dbg); + ccdbg_wait_reset(dbg); } void @@ -42,11 +43,12 @@ ccdbg_reset(struct ccdbg *dbg) ccdbg_debug(CC_DEBUG_COMMAND, "#\n"); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA|CC_RESET_N); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA ); + ccdbg_wait_reset(dbg); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA ); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA ); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA ); ccdbg_send(dbg, CC_CLOCK|CC_DATA|CC_RESET_N, CC_CLOCK|CC_DATA|CC_RESET_N); - ccdbg_sync_io(dbg); + ccdbg_wait_reset(dbg); } uint8_t -- cgit v1.2.3