From fec31947a6b4e77f65d92bf14b32533bbbc39b2d Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 2 Dec 2009 14:03:57 +0000 Subject: Removed John Steggall's software UART code from the XPLAIN Bridge project due to reliability issues. --- Projects/AVRISP/AVRISP.txt | 39 ++- Projects/XPLAINBridge/Lib/SoftUART.S | 464 ------------------------------- Projects/XPLAINBridge/Lib/SoftUART.h | 75 ----- Projects/XPLAINBridge/Lib/SoftUARTConf.h | 75 ----- Projects/XPLAINBridge/XPLAINBridge.c | 1 - 5 files changed, 37 insertions(+), 617 deletions(-) delete mode 100644 Projects/XPLAINBridge/Lib/SoftUART.S delete mode 100644 Projects/XPLAINBridge/Lib/SoftUART.h delete mode 100644 Projects/XPLAINBridge/Lib/SoftUARTConf.h (limited to 'Projects') diff --git a/Projects/AVRISP/AVRISP.txt b/Projects/AVRISP/AVRISP.txt index 0ccf72ace..670c168a7 100644 --- a/Projects/AVRISP/AVRISP.txt +++ b/Projects/AVRISP/AVRISP.txt @@ -108,8 +108,43 @@ * Connections to the device are simple for SPI programming: * * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
PDI Programming is not yet fully implemented.
Programmer Pin:Target Device Pin:ISP 6 Pin Layout:
MISODATA1
ADCx 1VTARGET2
N/AN/A3
N/AN/A4
PORTx.y 2CLOCK5
GNDGND6
+ * * \section SSec_Options Project Options * * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value. @@ -135,7 +170,7 @@ * Makefile CDEFS * Mask for the programmer's target RESET line on the chosen port. Must not be the AVR's /SS pin, as the * target pins are tri-stated when not in use, and low signals on the /SS pin will force SPI slave mode when the - * pin is configured as an input. + * pin is configured as an input. When in PDI programming mode, this is the target clock pin. * * * VTARGET_ADC_CHANNEL diff --git a/Projects/XPLAINBridge/Lib/SoftUART.S b/Projects/XPLAINBridge/Lib/SoftUART.S deleted file mode 100644 index 673067b84..000000000 --- a/Projects/XPLAINBridge/Lib/SoftUART.S +++ /dev/null @@ -1,464 +0,0 @@ -/* - - uart_soft - - v0.2 - - copyright John Steggall 2009 - -*/ - - -/* - Copyright 2009 John Steggall (steggall.j@gmail.com) - - Permission to use, copy, modify, and distribute this software - and its documentation for any purpose and without fee is hereby - granted, provided that the above copyright notice appear in all - copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -#include -#include "SoftUARTConf.h" - - -#define SFT_TX_EN 7 - -#define SF_UART_TX 1 -#define SF_UART_RX 2 - - .section .data - -rxdata: - .byte 0 -txShifter: - .byte 0 -txBitcount: - .byte 0 -rxShifter: - .byte 0 -rxBitcount: - .byte 0 - - .global status -status: - .byte 0 - - .section .text - - - .global RX_PIN_INT - -/********************************************* - * External interrupt - * - * RX pin has gone low. - */ -RX_PIN_INT: - push r16 - lds r16,SREG - push r16 - -#if (RXPORT>=32) - lds r16,RXPORT - sbrc r16,0 // anti glitch - -#else - sbic RXPORT,0 -#endif - - rjmp ignore - nop - nop - nop - nop - -#if (RXPORT>=32) - lds r16,RXPORT - sbrc r16,0 // anti glitch - -#else - sbic RXPORT,0 -#endif - - rjmp ignore - - push r17 - - // grab timer value - lds r16,TC_COUNTL - lds r17,TC_COUNTH - - // set trigger for RX timer (will need to add a little more though) - sts TC_RX_COMPH,r17 - sts TC_RX_COMPL,r16 - - pop r17 - - // set bitcount to 0 - ldi r16,0 - sts rxBitcount,r16 - - - // turn off interrupt, will get annoying. - cbi EXTI_MASK_REG,EXTI_MASK_BIT - - // turn on interrupt on compare match - - sbi TC_INTFLAG_REG,TC_RX_IF_BIT - - lds r16,TC_INT_MASK_REG - ori r16,(1<=32) - lds r17, TXPORT - sbrs r16,0 - andi r17,~(1<64 - lds r16,RXPORT - andi r16,~(1<=32) - lds r16,RXPORT - sbrs r16,RXPIN -#else - sbic RXPORT,RXPIN - -#endif - - inc r17 - dec r18 - nop - nop - nop - nop - brne loopGetBit - -#ifdef DEBUG - -#if RXPORT>64 - lds r16,RXPORT - ori r16,1<=32) - lds r16,RXPORT - sbrc r16,RXPIN - -#else - sbic RXPORT,RXPIN - -#endif - - ori r17,0x02 // set flag if stop bit was high - sts status,r17 - - lds r16,rxShifter // get contents of shifter - sbrc r17,1 // check if we just received a valid byte - sts rxdata,r16 // if valid rxdata = shifter - - // switch interrupt back on to get another go - - sbi EXTI_FLAG_REG,EXTI_MASK_BIT // clear interrupt flag - sbi EXTI_MASK_REG,EXTI_MASK_BIT // enable external interrupt 0 (RX) - - // switch off rx bit timer - lds r16,TC_INT_MASK_REG - andi r16,~(1<=32) - lds r18,TXPORT - ori r18,0x02 - sts TXPORT,r18 - - lds r18,TXDIR_REG - ori r18,0x02 - sts TXDIR_REG,r18 - -#else - sbi TXPORT,TXPIN - sbi TXDIR_REG,TXPIN - -#endif - - ldi r18,(1<=32) - lds r20, TXPORT - andi r20,~(1<