Discussion:
[PIC] 18F Serial Port
Anthony Nixon
2017-10-07 03:05:25 UTC
Permalink
Hi all,

I am using a 18 f47K40 for a project that uses the serial port on
RC6(Rx) and RC7(Rx) but cannot get the port to work.

I have many projects like this using 16F devices but I can't get this
one working.

I know the chip is functioning because of a led display working and as
far as I can tell the basic EUSART setup is the same as other chips I
have used.

I have not used the peripheral pin select before and may be that is the problem.

I am programming in assembler and all web examples are in C with
function calls that do not explain the pin setup process.

This is a snippet of the PPS code

BANKSEL RX1PPS

movlw b'00010111'
movwf RX1PPS,BANKED ; PORTC<7> as the EUSART1 RX input,

movlw b'00001001' ; PORTC<6> as the EUSART1 TX output
movwf RC6PPS,BANKED

Any help appreciated.

cheers

Tony
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Jason White
2017-10-07 03:11:17 UTC
Permalink
It may be interesting to disassemble the compiled output of the working C
examples
Post by Anthony Nixon
Hi all,
I am using a 18 f47K40 for a project that uses the serial port on
RC6(Rx) and RC7(Rx) but cannot get the port to work.
I have many projects like this using 16F devices but I can't get this
one working.
I know the chip is functioning because of a led display working and as
far as I can tell the basic EUSART setup is the same as other chips I
have used.
I have not used the peripheral pin select before and may be that is the problem.
I am programming in assembler and all web examples are in C with
function calls that do not explain the pin setup process.
This is a snippet of the PPS code
BANKSEL RX1PPS
movlw b'00010111'
movwf RX1PPS,BANKED ; PORTC<7> as the EUSART1 RX input,
movlw b'00001001' ; PORTC<6> as the EUSART1 TX output
movwf RC6PPS,BANKED
Any help appreciated.
cheers
Tony
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Jason White
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Anthony Nixon
2017-10-07 08:24:45 UTC
Permalink
Hi all,

Found the culprit after some hours of head scratching. I accidently
put a '1' instead of a '0' in the bit that enables the EUSART1 module.

cheers

Tony

On Sat, Oct 7, 2017 at 2:11 PM, Jason White
Post by Jason White
It may be interesting to disassemble the compiled output of the working C
examples
Post by Anthony Nixon
Hi all,
I am using a 18 f47K40 for a project that uses the serial port on
RC6(Rx) and RC7(Rx) but cannot get the port to work.
I have many projects like this using 16F devices but I can't get this
one working.
I know the chip is functioning because of a led display working and as
far as I can tell the basic EUSART setup is the same as other chips I
have used.
I have not used the peripheral pin select before and may be that is the problem.
I am programming in assembler and all web examples are in C with
function calls that do not explain the pin setup process.
This is a snippet of the PPS code
BANKSEL RX1PPS
movlw b'00010111'
movwf RX1PPS,BANKED ; PORTC<7> as the EUSART1 RX input,
movlw b'00001001' ; PORTC<6> as the EUSART1 TX output
movwf RC6PPS,BANKED
Any help appreciated.
cheers
Tony
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
Jason White
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
Loading...