Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC18F14K50 UART Problem

Status
Not open for further replies.

SAMIR_SBG

Newbie level 5
Joined
Apr 21, 2009
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,345
pic18f14k50

Hi,
I have made a small home made Eval board for PIC18F14K50 :
















I have a PicKit 2 Programmer
I use CCS Compiler v4.088
I Uuse Proteus ISIS v7.4 SP3 for Simulation.

My problem is when I use Port_B5 to receiving a RS232 data it don't wok on ISIS and on my Eval Board but when I use another port like Port_B6 it work fine on ISIS and on my Eval board!!
Cans some one help me if i have an error in my source code?

CCS source Code to transmit a receiver character:

#include <18F14K50.h>
#fuses NOWDT,NOPROTECT,NOLVP
#fuses HS
#FUSES CPUDIV1
#use delay(clock=20M)
#use rs232(baud=57600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8)
#use fast_io (B)

void main()
{
char a;
while(1)
{
a=getc();
putc(a);
}
}
 

pic18f14k50 schematic

Hi,

Those are some nice looking boards you have made there.

Am not into C, but in Assember you have to set the RX and the TX pins to Digital Input before turning on the Eusart module which then allocates them as it wants.

RB5 is also AN11, so again if its left at default perhaps this is why its not being used.

No idea how the eusart module can use RB6 as its not connected to the eusart hardware ? - unless your rs232 code is bit banging instead of using the eusart module ?
 

pic18f14k50 source code

Thank you "wp100" for your idea, finaly i was found the solution :
The RB5 digital input buffer must be enabled to use them for a digital input :)

void main()
{
char a;
#asm
bcf 0xF7F,3 //Enable digital input buffer of RB5
#endasm
while(1)
{
a=getc();
putc(a);
}
}
 

18f14k50.h ccs

Thats a very nice board!! Could you upload the PCB design please?
thank you!!
 

â—¦pic18f14k50

Hi zspikes

You can find joined the schematic and the PCB of my Eval board for PIC18F14K50.
 

pic18f14k50 evaluation board

Thank you very very much!!! :D
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top