CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC reset problem
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
POPE19



Joined: 27 Jun 2017
Posts: 71

View user's profile Send private message

PostPosted: Fri Sep 01, 2017 6:18 am     Reply with quote

It is connected to vdd (5v) (output from a 5v Voltage regulator) through 47k ohm resistor in series.
Ttelmah



Joined: 11 Mar 2010
Posts: 20058

View user's profile Send private message

PostPosted: Fri Sep 01, 2017 7:00 am     Reply with quote

The serial needing 1.9 seconds before it starts working, is 'odd'. Normally perhaps 20 or 30mSec, and certainly not over 1 second max. This says to me there is something strange happening.

How is the serial connection actually being done?. Are you using real serial or perhaps a USB-serial adapter?.

If the latter, are you unplugging this when you attempt to power the board down?.

I'm starting to suspect that your board is actually being powered by the adapter.
POPE19



Joined: 27 Jun 2017
Posts: 71

View user's profile Send private message

PostPosted: Fri Sep 01, 2017 7:20 am     Reply with quote

I am using ch340g usb to serial (TTL) module for serial connection. This is connected to usb port on my computer and board side connections are as follows:
Quote:

TTL Module | board (PIC)

TXD | pin-26 (RC7/RX)
RXD | pin 25 (RC6/TX)
GND | GND
(there is a jumper connected on TTL module between 5V & Vcc)

I am leaving it connected every time even when i disconnect the power to board.

Yes you are right after powering off the board i disconnected the module and plugged it back in after 2 sec, & then turning on the board power will display the phrase "Started".

Strange thing is i am running PIC16F917 same way but it still shows all messages as soon as i re-power the board and leave the TTL module plugged in all the time. Why only this one behaving so differently ?
Ttelmah



Joined: 11 Mar 2010
Posts: 20058

View user's profile Send private message

PostPosted: Fri Sep 01, 2017 8:24 am     Reply with quote

What is happening, is that the RX line coming into the PIC is trying to go up to just under 5v, and this via the protection diode in the PIC is pulling the supply rail up.
On either chip it is a dangerous design. On this one it is pulling the supply rail high enough that the chip is not completely powering down. This chip works down to 1.8v. The F917, 2v. I'd guess the supply rail is keeping up to perhaps about 1.7v. Problem is this risks damaging the chip in the CH340. It is driving this line into a near short, and long term could easily be damaged by this....
The other possibility is the 917 board is drawing a little more power, which will also allow it to power down. Either way the USB driver will be being overloaded...

Add a series resistor in the receive data line. Enough so that the line is not overloaded, and no longer pulls the supply rail up to the point where the chip doesn't think it has gone off....
POPE19



Joined: 27 Jun 2017
Posts: 71

View user's profile Send private message

PostPosted: Fri Sep 01, 2017 10:28 am     Reply with quote

Yes again. It works. I have used 1k ohm series resistor and it worked. It is driving vdd at 1.6 volts now well below 1.8v.

And this solves that delay serial print problem too. Now with 300 msec delay it is serial printing "started " without skipping s letter.

Thanks for the explanation.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group