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 support@ccsinfo.com

18F2550 + FT232RL pb to receive correct data

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PannetierJ



Joined: 18 Jun 2017
Posts: 31

View user's profile Send private message

18F2550 + FT232RL pb to receive correct data
PostPosted: Mon Jul 03, 2017 11:58 am     Reply with quote

Hello everybody,

I'm writing you because I'm trying to use an 18f2550 @ 8MHz crystal with an FT232RL for my RS232 connection.

My version of CCS info: 4.124

The electronic schema is:



My test code:
Code:

#include <18F2550.h>

#fuses HS,NOLVP,NOWDT
#use delay(clock=8000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,ERRORS)

void main()
{
   while(true)
   {
      putc('J');
   }
}


My config with Putty :





I tried different config into my code and Putty.

Nevertheless, I receive always this:



It's really strange.
It's alive but bad data... Different Control.

I tried different code on this forum, without success.

Best regards
Thank
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Mon Jul 03, 2017 12:11 pm     Reply with quote

Your problem is you are not running at 8MHz.
Missing fuse:
Code:

#include <18F2550.h>

#fuses HS,NOLVP,NOWDT,CPUDIV1
#use delay(clock=8000000)
#use rs232(baud=9600,xmit=PIN_C6,rcv=PIN_C7,ERRORS)


The default CPUDIV fuse is 4, so with an 8MHz crystal, you are running at 2Mhz....
PannetierJ



Joined: 18 Jun 2017
Posts: 31

View user's profile Send private message

PostPosted: Mon Jul 03, 2017 1:15 pm     Reply with quote

Hi Ttelmah,

Super, now i can write " Hello World " Smile

I didn't notice this Fuse ;)

I worked a whole afternoon yesterday, without seeing it.

Thank you
temtronic



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

View user's profile Send private message

PostPosted: Mon Jul 03, 2017 1:21 pm     Reply with quote

Sometimes it's 'eyes' 1/2 way round the World that can see what's wrong !

With those PICs I printout the 'clock diagram' and highlight the desired 'signal flow', then confirm the correct registers (SFRs) are being set/cleared.
It can be confusing....new PICs are far more complicated than the 16C84 !

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Mon Jul 03, 2017 11:47 pm     Reply with quote

Now, if you had done the 'flash an LED' test, you would have seen it was at 1/4 the speed expected, which might then have given you a clue 'where to look'. Anyway it was an easy one, where it has been 'met before'... Smile
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Tue Jul 04, 2017 3:27 am     Reply with quote

Just one thing: what you've got has nothing to do with RS232. Its a USB connection using a USB to serial converter. At no point is the data carried by anything like RS232 signals.

There's nothing wrong with that, using this sort of connection is a perfectly sensible and effective way of connecting a PC, or other USB host device, to the PIC, it's just that it is not RS232, and you can't connect a RS232 port to it.

I use this sort of connection and recommend it, just as several other regulars on this forum do, generally as it's easier and less hassle and effort than using PIC chips with built-in USB, but its USB (using a small subset of USB's capability, not that it matters all that much) not RS232. I note you are using a PIC18F2550, which, of course, has built-in USB. I hope to be able to congratulate you for the sense for not using the PIC's USB and using an external serial-USB IC instead, but something is telling me, it may not be quite like that...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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