Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
173164ce
Commit
173164ce
authored
Dec 04, 2017
by
Dean Camera
Browse files
Fix AVRISP-MKII Clone Programmer PDI entry sequence (thanks to Justin Mattair).
parent
bbdf6470
Changes
1
Hide whitespace changes
Inline
Side-by-side
Projects/AVRISP-MKII/Lib/XPROG/XPROGTarget.c
View file @
173164ce
...
...
@@ -39,7 +39,7 @@
#if defined(ENABLE_XPROG_PROTOCOL) || defined(__DOXYGEN__)
/** Flag to indicate if the USART is currently in Tx or Rx mode. */
bool
IsSending
;
static
bool
IsSending
;
/** Enables the target's PDI interface, holding the target in reset until PDI mode is exited. */
void
XPROGTarget_EnableTargetPDI
(
void
)
...
...
@@ -50,10 +50,15 @@ void XPROGTarget_EnableTargetPDI(void)
DDRD
|=
(
1
<<
5
)
|
(
1
<<
3
);
DDRD
&=
~
(
1
<<
2
);
/* Set DATA line high for at least 90ns to disable /RESET functionality */
PORTD
|=
(
1
<<
3
);
/* Set Tx (PDI CLOCK) high, DATA line low for at least 90ns to disable /RESET functionality */
PORTD
|=
(
1
<<
5
);
PORTD
&=
~
(
1
<<
3
);
_delay_us
(
100
);
/* Set DATA line high (enables PDI interface after 16 PDI CLK cycles) */
PORTD
|=
(
1
<<
3
);
_delay_us
(
20
);
/* Set up the synchronous USART for XMEGA communications - 8 data bits, even parity, 2 stop bits */
UBRR1
=
((
F_CPU
/
2
/
XPROG_HARDWARE_SPEED
)
-
1
);
UCSR1B
=
(
1
<<
TXEN1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment