PDA

View Full Version : Problem with Serout2 Pic18F4550



Vett58
- 22nd January 2012, 20:22
Hi :
I would appreciate if anyone can help me with this problem.
I am using SDFS code example with Pic18F4550. Although most of the code in the example is working fine , but the Serout2 is giving out garbage.
I checked and rechecked everything , but still no success , ofcourse I don`t think the problem has anything to do with SDFS , there must be something
that I am doing wrong with 18F4550 .
Thanks in advance .

Demon
- 22nd January 2012, 20:37
Is this the first time you use that PIC model?

What CONFIG settings are you using?

What version of PBP, MPASM, etc.

Robert

Vett58
- 22nd January 2012, 20:50
Is this the first time you use that PIC model?

What CONFIG settings are you using?

What version of PBP, MPASM, etc.

Robert

Thanks Robert.

this is the example which is not working :
Define OSC 20 ' 20 MHz oscillator
ADCON1 = 15 ' All I/O pins digital
Pause 100

Serout2 PORTC.6, 84, ["A,B,C"]

I am using PBP 3 - Microcode Studio Plus 5 - MPLAB IDE v8.80 and my device programmer is melabs U2 Programmer.
and I have put everything together based on SDFD schematics , connected to RS232 with a MAX232CPCE

Demon
- 22nd January 2012, 22:13
Are you sure about the oscillator setting? Didn't that change with PBP 3.0? (not sure)

What CONFIG settings did you use? that's often a source of problems.

Vett58
- 22nd January 2012, 22:22
Thanks Robert.
It looks like PBP3 automatically sets the config and it works for every other PIC that I have but 18F4550.
I tested it with various PICs and I even used a brand new 18F4550 , still getting garbage out of portc.6 .

Demon
- 22nd January 2012, 22:30
Did you try setting port C as output?

TRISC=0

Vett58
- 22nd January 2012, 22:34
Did you try setting port C as output?

TRISC=0

I did no change .
thanks

Demon
- 22nd January 2012, 22:38
Just looking at manual, they have a DEFINE for parity?

Not sure if this applies to 18F family.

Vett58
- 22nd January 2012, 22:48
Just looking at manual, they have a DEFINE for parity?

Not sure if this applies to 18F family.

I did try that too , I also tried other routines like HSEROUT or Debug with all the Define s required but still no luck.

I thank you so very much Robert for trying to help me.

Demon
- 22nd January 2012, 22:50
Set your DEFINE at 48, regardless of your external oscillator.

I just saw that in another thread just now.

EDIT: Right here:
http://www.picbasic.co.uk/forum/showthread.php?t=13039

Vett58
- 22nd January 2012, 22:56
Set your DEFINE at 48, regardless of your external oscillator.

I just saw that in another thread just now.

EDIT: Right here:
http://www.picbasic.co.uk/forum/showthread.php?t=13039

My goodness , you are a genius . It worked . You are a life saver.
Thanks ever so much. Robert.

Demon
- 22nd January 2012, 22:57
Like I once read in a men's room:



We aim to please.
You aim too, please.

Vett58
- 22nd January 2012, 23:04
Like I once read in a men's room:

Amazing solution. Once again I am truly grateful .