18F45k22 2nd EUSART

General discussion on Libstock website & codes posted on this website.
Post Reply
Author
Message
Mikrowave
Posts: 2
Joined: 07 May 2015 16:46
Location: Belgium

18F45k22 2nd EUSART

#1 Post by Mikrowave » 21 Jan 2016 16:00

Hi

Can someone tell me if it's possible to reroute the TX and RX pins of the 2nd EUSART of the 18F45K22 installed on the EasyPIC v7 board? And how this is done in code?

The 1st EUSART is used to receive the data from the GPS Click board. The RX and TX pins from the 2nd EUSART are used as control lines for the 128x64 GLCD. My project also uses this GLCD, so I need to have the RX and TX routed to other I/O pins.

Thanks
Patrick
Reach for the moon, the stars, and beyond !

User avatar
lana.arsic
mikroElektronika team
Posts: 1715
Joined: 15 Jan 2016 12:50

Re: 18F45k22 2nd EUSART

#2 Post by lana.arsic » 22 Jan 2016 17:42

Hello,

It isn't possible because PIC18F45K22 has fixed pins for Tx and Rx.

But, you don't need to reroute Tx and Rx pins to make GLCD and GPS click work together because GLCD don't even use RC6 and RC7 (which are used for Tx and Rx respectively).

You can look at our examples from a link bellow to see how it works:

http://www.libstock.com/projects/view/2 ... ck-example

Best regards,
Lana

Mikrowave
Posts: 2
Joined: 07 May 2015 16:46
Location: Belgium

Re: 18F45k22 2nd EUSART

#3 Post by Mikrowave » 22 Jan 2016 19:48

Thanks for your reply

1) The pins can not be rerouted: I was afraid this was going to be a problem. I will have to find another solution.

2) About your explanation and software example: there's a misunderstanding. Let me explain:

The GPS Click board is inserted in mikroBUS 1, as per the directions stated in the GPS Click board manual. In the schematic diagram you'll see that the RX and TX pins of the GPS Click board are connected to Port C bits RC7 and RC6 of the 18F45K22. Inside the 18F45K22, bits RC7 and RC6 are the RX and TX pins of EUSART#1. This is OK and my software works fine. No problem.

The GLCD on the EasyPIC v7 board uses 2 PIC ports: Port D as databus and port B bits B0-B5 as control lines. This is also OK and my software works fine to display the GPS data.

PROBLEM: In my project, I wish to use EUSART#2 of the 18F45K22. But the TX pin of EUSART 2 is connected to Port D bit RD6, and the RX pin is connected to Port D bit RD7. This is a problem, because RD6 and RD7 are part of the GLCD databus!

When I insert UART2_Init(1200); in my source code to initialise EUSART#2, the GLCD starts to display rubbish on the screen. Because, like I said, EUSART#2 uses RD6 and RD7.

That was the reason for my question: can RX and TX from EUSART#2 be rerouted to other pins, instead of Port D RD6 and RD7? But the answer is no and I will have to find another solution.

Maybe the MikroElektronica engineers:who designed the EasyPIC v7 board can connect the GLCD data bus to another port in v8, so that EUSART#2 can be used without any hassle.

Thanks for your reply.
Reach for the moon, the stars, and beyond !

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: 18F45k22 2nd EUSART

#4 Post by filip » 25 Jan 2016 10:01

Hi,
Maybe the MikroElektronica engineers:who designed the EasyPIC v7 board can connect the GLCD data bus to another port in v8, so that EUSART#2 can be used without any hassle.
Thanks for the tip.

Since there are only 40 pins, it would be tough challenge to use any whole port only for Glcd so it does not interfere with some other MCU module.

Regards,
Filip.

Post Reply

Return to “Libstock Discussion”