View previous topic :: View next topic |
Author |
Message |
JerryR
Joined: 07 Feb 2008 Posts: 164
|
Using RB6 and RB7 as EUSART while in debug |
Posted: Mon Feb 08, 2016 4:27 pm |
|
|
I usually stay clear of using debug/programming resources as general IO, but I'm against the wall here on a new design.
I've connected a single channel Maxim RS-232 level translator (MAX3311E) to RB6 and RB7 with the intention of using the EUSART on a PIC16C1784 microcontroller. A PICKIT3 and an ICD3 refuses to debug with the MAXIM device in-circuit, even with the MAX3311E in shutdown. I can program the PIC and it runs fine, just will not debug. Yes, the dreaded "ICD3Err0040: The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding."
I can't imagine why the debugger can't share these lines.
I also have a RealICE, but have not tried it as yet?
I'm using MPLAB with CCS C PCWH v5.021.
Any suggestions group? I appreciate your help! |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Feb 08, 2016 7:24 pm |
|
|
The MAX3311E data sheet says on page 5:
Quote: | The MAX3311E receiver will remain active during shutdown. |
The receiver has a 5K pull-down resistor on the input. Assuming you
don't a RS-232 cable connected, this pulldown will cause the receiver
section to output a high level. This high logic level will undoubtedly
interfere with your ICD3 debugger.
A possible solution would be to find a RS-232 level shifter that puts all
outputs into High-Z state when it's disabled or in shutdown mode. |
|
![](templates/subSilver/images/spacer.gif) |
JerryR
Joined: 07 Feb 2008 Posts: 164
|
|
Posted: Mon Feb 08, 2016 7:59 pm |
|
|
Thanks PCM. I'll research this tomorrow and get back. |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon Feb 08, 2016 8:55 pm |
|
|
try this-
on the RX input of the MAXIM - add a 2n3904 as an emitter follower with collector tied to 5v and emitter on the RX input
the floating base is your TX send-to pin.
if you really have to -add a 100k or less pull resistor UP from the base to +5v
i bet you it works.... |
|
![](templates/subSilver/images/spacer.gif) |
JerryR
Joined: 07 Feb 2008 Posts: 164
|
|
Posted: Tue Feb 09, 2016 6:31 am |
|
|
Hi asmboy:
Thanks for the reply. I am going to isolate the rx and may try your suggestion later today.
Regards |
|
![](templates/subSilver/images/spacer.gif) |
JerryR
Joined: 07 Feb 2008 Posts: 164
|
|
Posted: Tue Feb 09, 2016 8:46 am |
|
|
PCM: Good call! Missed the effects of the pull-up on the RX input line. Isolated the RX output and debugging is happy now.
Asmboy: I may try your fix. Another pass on the PCB.
Great asset you two. Design review via forum board.
Regards |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Feb 09, 2016 9:52 am |
|
|
Figure 2 on the data sheet shows schematically what PCM was talking about.
in the case of RS-232 TTL i would expect a WEAK pull UP to be the default input state - so the what MAXIM has done strikes me as ODD - though it might have something to do with their data_valid monitor feature/bug ;-))
i am betting you can find out by just hacking a TO-92 leaded version of the transistor onto your present PCB to find out. |
|
![](templates/subSilver/images/spacer.gif) |
JerryR
Joined: 07 Feb 2008 Posts: 164
|
|
Posted: Tue Feb 09, 2016 10:02 am |
|
|
Asmboy:
I'm guessing MAXIM wanted to maintain the RX in a predictable state by pulling the RX in low. Kind of surprised me too!
Best regards and, again, thanks for your interest. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19360
|
|
Posted: Tue Feb 09, 2016 11:35 am |
|
|
They are following the RS232 standard, so having 'off' reported as 'break'. |
|
![](templates/subSilver/images/spacer.gif) |
|