Pic18F4550 RS232 sending a string
Moderator: Benj
Pic18F4550 RS232 sending a string
The program below will not send a simple string from the 18F4550 to a terminal program.
I have tried several way to send a string but no output. The program has a simple in/output routine for RS232 that works just fine
I have transfer the program to a 16F88 and it send the string and echo's just fine.
What am I missing??
I have tried several way to send a string but no output. The program has a simple in/output routine for RS232 that works just fine
I have transfer the program to a 16F88 and it send the string and echo's just fine.
What am I missing??
- Attachments
-
- 18f4550 simple rs232.fcf
- (6 KiB) Downloaded 375 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Pic18F4550 RS232 sending a string
Hi Errol,
Not had a chance to test Flowchart on hardware, so don't know If attached file will work or not?
You could do the toggle a pin at 1HZ test to check hardware and configuration settings.
Can you let us know how you get on.
Thanks
Martin
Not had a chance to test Flowchart on hardware, so don't know If attached file will work or not?
You could do the toggle a pin at 1HZ test to check hardware and configuration settings.
Can you let us know how you get on.
Thanks
Martin
- Attachments
-
- 18f4550 simple rs232_1.fcf
- (8 KiB) Downloaded 376 times
Martin
Re: Pic18F4550 RS232 sending a string
Hi Martin
I was unable to load your modified Flowcode program, was it created in Flowcode 5? I'm running Flowcode 4.5.
I have setup a led to toggle at a 1 sec rate so I know the program is running. The simple echo does work.
Best regard
Errol
I was unable to load your modified Flowcode program, was it created in Flowcode 5? I'm running Flowcode 4.5.
I have setup a led to toggle at a 1 sec rate so I know the program is running. The simple echo does work.
Best regard
Errol
- JohnCrow
- Valued Contributor
- Posts: 1367
- Joined: Wed Sep 19, 2007 1:21 pm
- Location: Lincolnshire
- Has thanked: 364 times
- Been thanked: 716 times
Re: Pic18F4550 RS232 sending a string
Hi Errol
Ive just had a quick look at the program Martin posted and tried to copy it to FC4 for you.
Not sure if I may have missed anything though.
Ive just had a quick look at the program Martin posted and tried to copy it to FC4 for you.
Not sure if I may have missed anything though.
1 in 10 people understand binary, the other one doesn't !
Re: Pic18F4550 RS232 sending a string
Thank John
I think the one you posted is the one I posted. Martins has an _1 and mine does not.
Cheers
Errol
I think the one you posted is the one I posted. Martins has an _1 and mine does not.
Cheers
Errol
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Pic18F4550 RS232 sending a string
Hi Errol
I was in a rush.
The Flowchart John posted looks like it is correct
I have got a 18F4455 and have not got a 4MHz xtal.
After configuring to 4MHz internal oscillator (adding osscon = 0x60; )
etc your program is running ok for me with hyperterminal and RS232 Eblock
The keys are echoing on the screen
Can you state if you are using a 4MHz crystal or not, and what pins of microcontroller have you got RX and TX of RS232 connected to?
Thanks John for posting a V4 version.
Martin
Sorry, I have been using V5 a lot recently so just naturally used it to alter settings.Errol wrote:Hi Martin
I was unable to load your modified Flowcode program, was it created in Flowcode 5? I'm running Flowcode 4.5.
Errol
I was in a rush.
The Flowchart John posted looks like it is correct
I have got a 18F4455 and have not got a 4MHz xtal.
After configuring to 4MHz internal oscillator (adding osscon = 0x60; )
etc your program is running ok for me with hyperterminal and RS232 Eblock
The keys are echoing on the screen
Can you state if you are using a 4MHz crystal or not, and what pins of microcontroller have you got RX and TX of RS232 connected to?
Thanks John for posting a V4 version.
Martin
Martin
Re: Pic18F4550 RS232 sending a string
Hi Martin
First I'm using pins 25/26 standard rs232 pins, I'm using a 4Mhz crystal. I decided to switch to an 16F877A on the same proto-type board,
the program works like it should.
I have a 18F2550 proto-type board that I will try tomarrow. But right now I think there is a bug with the complyer.
Have checked the C code (compared the 18f4550 and 16F877A) and can not find anything wrong.
I do not have a 18f4455 or I would give that a try.
Cheers
Errol
First I'm using pins 25/26 standard rs232 pins, I'm using a 4Mhz crystal. I decided to switch to an 16F877A on the same proto-type board,
the program works like it should.
I have a 18F2550 proto-type board that I will try tomarrow. But right now I think there is a bug with the complyer.
Have checked the C code (compared the 18f4550 and 16F877A) and can not find anything wrong.
I do not have a 18f4455 or I would give that a try.
Cheers
Errol
Re: Pic18F4550 RS232 sending a string
Hi Martin
Did you mean osccon=0x60;
Can you tell me how the following were set under chip==>configure
USB CLOCK=
CPU SYS CLK =
OSC SELECT =
OSCILLATOR =
I have now tried my first program with a 18F2550 with no luck and tried it with osccon=0x60;.
I do have a work around that works. It is a Flowcode that I found on the forum
that I have reworked. It works with a 4Mhz crystal.
Errol
Did you mean osccon=0x60;
Can you tell me how the following were set under chip==>configure
USB CLOCK=
CPU SYS CLK =
OSC SELECT =
OSCILLATOR =
I have now tried my first program with a 18F2550 with no luck and tried it with osccon=0x60;.
I do have a work around that works. It is a Flowcode that I found on the forum
that I have reworked. It works with a 4Mhz crystal.
Errol
- Attachments
-
- rs232StringMacro.fcf
- (7.5 KiB) Downloaded 352 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Pic18F4550 RS232 sending a string
Here is a screen shot of configuration: Hope it helpsErrol wrote: Did you mean osccon=0x60;
Yes I did
Martin
Martin
Re: Pic18F4550& 18F2550 RS232 sending a string
I've been away for a while. Been working on a couple of solar projects.
Decided to buy the upgrade to V5 and am back to the same old problem The SendRS232String just does not work....
I have attached a PIC18F2550 flowcode v5.5x.
I use a VT100 escape code macro to clear the screen and am using 9600 baud 8bit no parity one stop.
Configuration looks like this: I can not believe that this is not happening to others.
If any one has any ideas? or is this a problem that has carried over from 4.5?
Decided to buy the upgrade to V5 and am back to the same old problem The SendRS232String just does not work....
I have attached a PIC18F2550 flowcode v5.5x.
I use a VT100 escape code macro to clear the screen and am using 9600 baud 8bit no parity one stop.
Configuration looks like this: I can not believe that this is not happening to others.
If any one has any ideas? or is this a problem that has carried over from 4.5?
- Attachments
-
- 2. Simple Echo 18F2550.fcf
- (15 KiB) Downloaded 356 times
Re: Pic18F4550 RS232 sending a string
HI Errol
Try setting your config as attached image and see if it helps, i suspect its a config issue as you say it works with another chip, also your using a 28pin chip yes , if so rx tx is on pins 17 and 18 ,pins 25/26 are rx tx on the 40pin chips
Regards
Dazz
Try setting your config as attached image and see if it helps, i suspect its a config issue as you say it works with another chip, also your using a 28pin chip yes , if so rx tx is on pins 17 and 18 ,pins 25/26 are rx tx on the 40pin chips
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
Re: Pic18F4550 RS232 sending a string
Hi Dazz
You must walk on water, the changes you suggested did the trick
I thought that I had tried every combination but did not even considered your changes....
I'm not sure how to send you a thanks so you will have to settle for a Thank You
Errol
You must walk on water, the changes you suggested did the trick
I thought that I had tried every combination but did not even considered your changes....
I'm not sure how to send you a thanks so you will have to settle for a Thank You
Errol
Re: Pic18F4550 RS232 sending a string
Hi Errol
Power Up Timer justs adds a delay so the oscillator can stabilize
Port BA/D Enable switches port b to either digital or analogue (seems to play havoc with lcd's)
Low Voltage Program does weird things to the chip if programing at higher voltages
Extended Cpu Enable Adds an extra set of assembler instructions to the pic, and if not used (ie by flowcode) can have strange affects on the program
to thank if you look at a post between the options box and the username theres a thumbs up icon click on it and it gives thanks
Regards
Dazz
Power Up Timer justs adds a delay so the oscillator can stabilize
Port BA/D Enable switches port b to either digital or analogue (seems to play havoc with lcd's)
Low Voltage Program does weird things to the chip if programing at higher voltages
Extended Cpu Enable Adds an extra set of assembler instructions to the pic, and if not used (ie by flowcode) can have strange affects on the program
to thank if you look at a post between the options box and the username theres a thumbs up icon click on it and it gives thanks
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php