AnsweredHot!UART not working without pickit

Author
eduard
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2012/11/12 12:01:29
  • Location: 0
  • Status: offline
2017/10/07 09:32:11 (permalink)
0

UART not working without pickit

 I programmed the UART of a 16f877a with pickit3. All works well till I disconnect the communication cable between the microchip and the programmer. There is no communication anymore over the UART. It seems the UART is dead till I connect the pickit again, al works fine then.
#1
DarioG
leaving this planet
  • Total Posts : 53011
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: online
Re: UART not working without pickit 2017/10/07 09:36:49 (permalink) ☼ Best Answerby eduard 2017/10/07 10:18:33
0
Grounding? MCLR, LVP, Debug mode...?

Dario Greggio
--
how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

#2
eduard
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2012/11/12 12:01:29
  • Location: 0
  • Status: offline
Re: UART not working without pickit 2017/10/07 10:22:58 (permalink)
0
I read this in other post already. LVP is not connect, MCLR is on Vcc with a 10k resistor, ground is okee. 
 
#3
eduard
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2012/11/12 12:01:29
  • Location: 0
  • Status: offline
Re: UART not working without pickit 2017/10/07 10:26:51 (permalink)
0
How to check out if the PIC is in debug mode?
#4
DarioG
leaving this planet
  • Total Posts : 53011
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: online
Re: UART not working without pickit 2017/10/07 12:00:30 (permalink)
0
good :)
but please cross-connect your related threads:
http://www.microchip.com/.../m1018644.aspx#1018644

Dario Greggio
--
how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

#5
JorgeF
Super Member
  • Total Posts : 2777
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: Barcelona/Spain/Europe/Third rock from the Sun
  • Status: offline
Re: UART not working without pickit 2017/10/07 12:08:42 (permalink)
+1 (1)
Hi
 
You probably programmed the PIC with a debug build that depends on the pickit and the debugger for the debug executive operation.
Reprogram it with a "release" build instead.
 
 
Best regards
Jorge
 
#6
eduard
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2012/11/12 12:01:29
  • Location: 0
  • Status: offline
Re: UART not working without pickit 2017/10/07 13:37:25 (permalink)
0
Dear Jorge,
 
The PicKit3 1 page manual says:  
/*
To execute your code in Debug mode, perform a debug run by selecting
Debug>Debug Project. A debug run will build the project, program the target with
the image and debug executive, and start a debug session.
OR
To execute your code in Non-Debug (release) mode, perform a run by selecting
Run>Run Project. A run will build the project, program the target with the image
and run the device.
To hold a device in Reset after programming, use the Hold in Reset icon in the
toolbar instead of using Run Project.
*/
 
Although there is no 'Run' in the menu bar anymore but is replaced by 'Production' in the IDE v4.01. Under production I can not find 'Run' at all, the same in previous versions. So I use the green arrowed 'RunProject' button. Somewhere I read this is also a 'release' mode setting, or is this not?
Also I set the 'DEBUG' bit OFF in the Configuration register of the Pic. Bit silly because for what I know this is done by the compiler when you choose for a debug mode button or a release mode button.
 
So for I know I did use the release mode and not a debug mode, did I?
 
Best Regards,
Eduard.
#7
eduard
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2012/11/12 12:01:29
  • Location: 0
  • Status: offline
Re: UART not working without pickit 2017/10/07 13:40:50 (permalink)
0
Dear Dario,
 
I am new on this forum, can you tell me how to make a cross-connection?
It shall be easy, not?
 
Regards
Eduard
 
#8
JorgeF
Super Member
  • Total Posts : 2777
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: Barcelona/Spain/Europe/Third rock from the Sun
  • Status: offline
Re: UART not working without pickit 2017/10/07 14:22:35 (permalink)
+1 (1)
Hi
eduard
Dear Dario,
 
I am new on this forum, can you tell me how to make a cross-connection?
It shall be easy, not?
 
Regards
Eduard
 

Hi
That one is easy.
Just grab a "permalink" from one topic/post and paste it on a post of the other topic.
 
This way we can all track different topics related to the same user/project or issue.
 
 
Just my 2 cents....
 
 
Best regards
Jorge
 
post edited by JorgeF - 2017/10/07 14:24:00
#9
JorgeF
Super Member
  • Total Posts : 2777
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: Barcelona/Spain/Europe/Third rock from the Sun
  • Status: offline
Re: UART not working without pickit 2017/10/07 14:31:41 (permalink)
+1 (1)
Hi
 
eduard
Also I set the 'DEBUG' bit OFF in the Configuration register of the Pic. Bit silly because for what I know this is done by the compiler when you choose for a debug mode button or a release mode button.

Not exactly.
What the documentation says is that when debugging the DEBUG bit is handled by the debugger.
When you program a release build the PIC receives whatever you put in the "CONFIG" statements, that is why you need to explicitly set the DEBUG bit OFF in your code.
 
eduard 
So for I know I did use the release mode and not a debug mode, did I?

Well, in that case get back to electrical issues.
Ground quality, power supply noise, etc...
Think of any electrical condition that can be affected by the presence of the pickit hardware connected to your circuit.
 
 
Best regards
Jorge
 
 
#10
qhb
Superb Member
  • Total Posts : 6224
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: UART not working without pickit 2017/10/07 14:35:29 (permalink)
+2 (2)
My money is on you forgetting to connect the ground between your serial devices, and you're getting it for free when the PK3 is connected.
 
#11
JorgeF
Super Member
  • Total Posts : 2777
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: Barcelona/Spain/Europe/Third rock from the Sun
  • Status: offline
Re: UART not working without pickit 2017/10/07 14:41:53 (permalink)
+1 (1)
qhb
My money is on you forgetting to connect the ground between your serial devices, and you're getting it for free when the PK3 is connected.
 

+1
#12
eduard
New Member
  • Total Posts : 11
  • Reward points : 0
  • Joined: 2012/11/12 12:01:29
  • Location: 0
  • Status: offline
Re: UART not working without pickit 2017/10/07 15:04:28 (permalink)
0
Dear qhb,
 
I love you, it's working now without the PicKit.
 
 @ Jorge: Your right I mixed up compiler and debugger. But why is the DEBUG bit not in the 'Set Configuration bits' dropdown list if you have to set it yourself?
 
problem solved
Thank to you all.
 
Eduard 
#13
qhb
Superb Member
  • Total Posts : 6224
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: UART not working without pickit 2017/10/07 15:10:10 (permalink)
0
eduard
I love you, it's working now without the PicKit.

You're not alone. I've seen plenty of people make that mistake.
 

Your right I mixed up compiler and debugger. But why is the DEBUG bit not in the 'Set Configuration bits' dropdown list if you have to set it yourself?

You do NOT have to set it yourself.
You should NEVER touch that bit at all, let the tools manage it.
 
#14
qhb
Superb Member
  • Total Posts : 6224
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: UART not working without pickit 2017/10/07 15:19:01 (permalink)
+1 (1)
JorgeF
...
that is why you need to explicitly set the DEBUG bit OFF in your code.

I'm going to respectfully disagree here.
The better advice is "Do not set the DEBUG bit to ON in your code."
 
The safest way is simply not to refer to it all.
 
#15
JorgeF
Super Member
  • Total Posts : 2777
  • Reward points : 0
  • Joined: 2011/07/09 11:56:58
  • Location: Barcelona/Spain/Europe/Third rock from the Sun
  • Status: offline
Re: UART not working without pickit 2017/10/07 15:24:25 (permalink)
+1 (1)
Hi
qhb
JorgeF
...
that is why you need to explicitly set the DEBUG bit OFF in your code.

I'm going to respectfully disagree here.
The better advice is "Do not set the DEBUG bit to ON in your code."
The safest way is simply not to refer to it all.



Agreed, and it might be the reason that the OP can't find it in the "dropdown".
Well not everybody does everything with the "milion clicks interface", and some of us were born well before the "X" thing.   ;)
 
BTW, I'm not exactly a "defaults believer".
 
 
Best regards
Jorge
 
 
#16
DarioG
leaving this planet
  • Total Posts : 53011
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: online
Re: UART not working without pickit 2017/10/07 15:56:39 (permalink)
0
qhb

My money is on you forgetting to connect the ground between your serial devices, and you're getting it for free when the PK3 is connected.


 
eduard
Dear qhb,
I love you, it's working now without the PicKit.



DarioG
Grounding? MCLR, LVP, Debug mode...?
Dario Greggio
--
mybooks: https://www.lulu.com/shop...ords=greggio&type=

 
good night everybody grin

Dario Greggio
--
how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

#17
qhb
Superb Member
  • Total Posts : 6224
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: offline
Re: UART not working without pickit 2017/10/07 16:20:26 (permalink)
+1 (1)
Too many options Dario.  ;)
Everyone concentrated on Debug mode after that, which is why I chimed in. :)
 
#18
DarioG
leaving this planet
  • Total Posts : 53011
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: online
Re: UART not working without pickit 2017/10/07 16:52:45 (permalink)
0
You're right Smile
it's the f*ing female-like multitasking brain that thinks and writes too much (!)

Dario Greggio
--
how does it feel, never having been loved? as life fades away, day after day, on this planet made of s h i t...

#19
Jump to:
© 2017 APG vNext Commercial Version 4.5