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

18LF2620 serial port issue
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BLL



Joined: 11 Nov 2006
Posts: 181
Location: Birmingham, UK

View user's profile Send private message

18LF2620 serial port issue
PostPosted: Wed Sep 09, 2015 3:18 pm     Reply with quote

Hi, I am being driven mad by a serial port!
I have an 18LF2620 running on 3.3V, using a 10MHz crystal. The port is on RC6 and 7. It is set at 9600Bd. Connected to this port is a pl2303 serial to USB converter, which goes to my PC. I use a resistive divider on the rcv line, so the 5V of the pl2303's TX line is reduced to 3.3V for the PIC.
I have used the very simple test program from the manual
printf("start");
while(true)
putc(getc()+1);

From the terminal program, if I type characters at more than about 2 per second, I see the correct response. If I slowly type, nothing comes back until I type faster, when it catches up! The power line is stable, the PIC has a 0.1 at its supply pins.

What is likely to be causing this strange behaviour please?

Any help much appreciated.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Wed Sep 09, 2015 4:02 pm     Reply with quote

post a schematic -
your COMPLETE minimum program that shows the problem
and compiler version.

too much to guess at otherwise.

BTW: why are you using brand-X instead of nice reliable FTDI FT-232 chip ??
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Sep 09, 2015 10:09 pm     Reply with quote

asmboy wrote:
post a schematic -
your COMPLETE minimum program that shows the problem
and compiler version.

too much to guess at otherwise.

BTW: why are you using brand-X instead of nice reliable FTDI FT-232 chip ??


Reliable FTDI chip? You might want to look at some Arduino posts on the subject of FTDI drivers and what FTDI did in an attempt to nobble counterfeit chips. It blew back on FTDI big time. Turns out a lot of end users, including myself, buy products without knowing or caring who manufactures a minor component and are understandable upset when FTDI, through a windows update, bricked their product. A safe path for equipment designers, that do not control sourcing of the final components (as happens with outsourced manufacturing), is to use some other component.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!


Last edited by asmallri on Thu Sep 10, 2015 6:02 pm; edited 1 time in total
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: 18LF2620 serial port issue
PostPosted: Wed Sep 09, 2015 10:11 pm     Reply with quote

BLL wrote:
Hi, I am being driven mad by a serial port!
I have an 18LF2620 running on 3.3V, using a 10MHz crystal. The port is on RC6 and 7. It is set at 9600Bd. Connected to this port is a pl2303 serial to USB converter, which goes to my PC. I use a resistive divider on the rcv line, so the 5V of the pl2303's TX line is reduced to 3.3V for the PIC.
I have used the very simple test program from the manual
printf("start");
while(true)
putc(getc()+1);

From the terminal program, if I type characters at more than about 2 per second, I see the correct response. If I slowly type, nothing comes back until I type faster, when it catches up! The power line is stable, the PIC has a 0.1 at its supply pins.

What is likely to be causing this strange behaviour please?

Any help much appreciated.


Change your terminal program?
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Sep 10, 2015 5:20 am     Reply with quote

couple of test options...

1) disconnect PIC and just loopback the USBTTL adapter and see what happens.....

2) Run the PIC at 5 volts and see what happens. This assuming it's rated for 5 volts, I didn't check...too many PICs, too little time !

BTW I've never had any issues with the $2 'knockoff' USBTTL modules.
Jay
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Sep 10, 2015 9:16 am     Reply with quote

asmallri wrote:
Reliable FTDI chip? You might want to look at some Arduino posts on the subject of FTDI drivers and what FTDI did in an attempt to nobble counterfeit chips. It blew back on FTDI big time. Turns out a lot of end users, including myself, buy their appliances without knowing or caring who manufactures a minor component and are understandable upset when FTDI, through a windows update, bricked their product. A safe path for equipment designers, that do not control sourcing of the final components (as happens with outsourced manufacturing, is to use some other component.


The FTDI 'controversy' has absolutely nothing to do with the reliability of FTDI chips and drivers, so you are simply muddying the waters here to pontificate against FTDI, IMHO. As always, there are two sides to every story, and I think this article sums them both up pretty well:

http://tymkrs.tumblr.com/post/100749183024/ftdigate

I can sympathize with a company that tries to defeat those that steal their intellectual property, and diminish their business! But, on the other hand, the methods employed seem a bit heavy-handed! Clearly, it's not a simple issue! I just figured a more 'balanced' presentation on the topic was warranted....
_________________
John

If it's worth doing, it's worth doing in real hardware!
BLL



Joined: 11 Nov 2006
Posts: 181
Location: Birmingham, UK

View user's profile Send private message

18LF2620 serial problem
PostPosted: Thu Sep 10, 2015 2:14 pm     Reply with quote

hanks for the reply. The simple test code was in my first post. I would include an image of the circuit if I could see how to do it!! It's a jpeg but the insert image doesn't appear right. Having not included as image before, I am lost!
BLL



Joined: 11 Nov 2006
Posts: 181
Location: Birmingham, UK

View user's profile Send private message

18LF2620 serial problem
PostPosted: Thu Sep 10, 2015 2:17 pm     Reply with quote

To the gentleman suggesting loopback of the usb/serial adaptor, this works fine. I can't run the pic at 5V as there is an smt chip on the board which will fail if run over 3.3V, so that's not an option!!
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Sep 10, 2015 2:45 pm     Reply with quote

Hi,

Sorry for adding a bit of 'chafe' (above) to your thread Very Happy !

To show us your schematic, you need to post the image to a free image hosting site (for example), and then post the link to the image here. Chances are you have a level incompatibility issue that we will be able to identify and help you to resolve once we see your schematic.

Example image hosting site: http://postimage.org/
_________________
John

If it's worth doing, it's worth doing in real hardware!
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Sep 10, 2015 2:47 pm     Reply with quote

Well good news is you can eliminate the PC terminal program and the USBTTL module as 'loopback' functions fine...

So...

Using resistors to lower the 5V USB rcv signal to the 3V PIC will work to allow it to receive data ..

But, and there's always a 'but'....

Your 3V PIC might not be outputting a high enough '1' for the USBTTL module to see as a proper '1'. If it needs 80% of it's VCC of say 5 volts, that's 4 volt the PIC would have to produce and that can't happen runnin git on a VDD of 3 volts.

You might also post your test program, could be a simple thing like not having 'errors' in the USE RS232(....options...).

Jay
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Sep 10, 2015 6:11 pm     Reply with quote

deleted because my mind was out of phase with reality.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!


Last edited by asmallri on Thu Sep 10, 2015 9:44 pm; edited 1 time in total
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Sep 10, 2015 8:24 pm     Reply with quote

do you connect like this?

https://commons.wikimedia.org/wiki/File%3A3_volt_interface_to_5_v_controller.pdf

if not, you might try it.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Sep 10, 2015 9:16 pm     Reply with quote

asmallri wrote:
Balanced? The pot calling the kettle black? Dementia?
Was't it you that unsolicitedly pontificated (I like that word) the use of an FDTI in lieu of the pl2303?


No, that was asmboy that recommended the FTDI (you said FDTI???), not me! I'm not sure why that matters - he has an opinion on the matter, just like you!

Err, what is not 'balanced' about a post that includes more than 10 bullet points from *each* side of a given argument?? Did you even read the link??

Pot calling the kettle black??? Huh??? Here is the definition of 'Pontificate': to speak or express opinions in a pompous or dogmatic way. I wasn't expressing an opinion at all. What I did do was post a link to the arguments for your point of view, and against it. How is that 'the pot calling the kettle black'???

Dementia??? If you knew anything about *real* dementia you probably wouldn't go there......

I guess you are super-sensitive about this issue, and/or have a VERY thin skin Wink
_________________
John

If it's worth doing, it's worth doing in real hardware!
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Sep 10, 2015 9:44 pm     Reply with quote

Sorry ezflyr it is me suffering from dementia :-)

I mistakenly thought you posted this comment earlier: "BTW: why are you using brand-X instead of nice reliable FTDI FT-232 chip ??"
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Fri Sep 11, 2015 9:48 am     Reply with quote

my comment was not meant to disrespect Prolific USB bridge chips but in my direct experience - the PL 2303 is not the best part for the application.

1- the part has no meaningful distribution in north america - just a lonely sales office in Canada.

AND
2- has been plagued in the past with issues of using an unsigned
driver for windows.

On the other hand my consultancy and a manufacturing partner have been shipping a 3 port bridge design "universal bridge card" that is an any-port to all ports hub :: with TTL, RS-232 +/-8v signalling, and USB courtesy of an FT-232 chip. we've shipped thousands of these as an OEM vendor for use in very high end research instruments , deployed round the globe.

And in the nearly 4 years of shipping the product have had near zero failures and no issues with driver support EVER. including during the period when FTDI were ( misguidedly IMHO) trying to protect their I.P. through suspect technical means.

I was not pleased with the driver debacle FTDI initiated , but i did not have a dog in the hunt due to no problems for me or my customers.

And it was in nobody's interest for me to engage in "knee-jerk" re engineering fixes for a part that was causing no grief to my bottom line or my customers.

Perhaps it is possible that they are not the nicest company in their tactics, but i have never had an issue with the parts being genuine , matching the spec sheet and being of high reliability in the field. When you sell to customers who include your $30 product in their $50K instrument - you don't fix what ain't broke..... Very Happy Very Happy Very Happy
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 1, 2  Next
Page 1 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