Page 1 of 2

18F67K40 UART Problem

Posted: Tue Jul 30, 2019 8:01 am
by seokgi
Hi. Everyone
I have to use five rs-232.
So I chose the PIC18F67K40.
But UART does not work.
Is the option wrongly selected?
I do not know the cause.
Can you help me?
Attach the file.
Thank you.

Re: 18F67K40 UART Problem

Posted: Tue Jul 30, 2019 1:05 pm
by Lagoda
Hi, Seokgi

The clock signal of target circuit is it working ?
I think, if the clock source is an HS quartz crystal connected to the OSC1 and OSC2 pins, then the OSC2 output must be enabled in the Project Option / Configure window.

Best Regards,

Lagoda

Re: 18F67K40 UART Problem

Posted: Tue Jul 30, 2019 1:54 pm
by seokgi
Thank you.
Circuit is working.
But uart is not work.

Re: 18F67K40 UART Problem

Posted: Tue Jul 30, 2019 2:59 pm
by LeighM
Do the UARTs output anything, even if invalid data?
Do you have an oscilloscope to check?
The clock speed in Project Options looks odd, is it correct?

Re: 18F67K40 UART Problem

Posted: Tue Jul 30, 2019 3:19 pm
by seokgi
The execution of the project file was confirmed with led.
Since it is necessary to use rs-232 2400 bps or data bit 7bit, we use 22.1184MHz which is double of 11.0592MHz.
I measured it with an oscilloscope, but no data at all.
And there seems to be a problem with MCLR RE3. RE3 will still work with the output.
Every time I use FC8, I am always in trouble. I chose FC8 because I could not C language.

Thank you for your help.

Re: 18F67K40 UART Problem

Posted: Tue Jul 30, 2019 10:34 pm
by Lagoda
Hi,

According to the MPLAB Code Configurator: " External clock frequency is greater than recommended value(20MHz) "
You may have to try with a lower frequency.
But this is just an idea.


Unfortunately the MCLR pin can only be input port.
MCLR Disabled.png
MCLR Disabled.png (12.59 KiB) Viewed 2641 times

Lagoda

Using MPLABX, I created a test program similar to the one you made in Flowcode.
I couldn't try it because I don't have this type of MCU.
All 5 TX outputs are supposed to send characters. The other ports will not move.

Re: 18F67K40 UART Problem

Posted: Tue Jul 30, 2019 11:25 pm
by seokgi
Unfortunately I do not know C Language.
Thank you for your interest.

I would like to have a deep interest in Matrix.

Re: 18F67K40 UART Problem

Posted: Thu Aug 01, 2019 7:35 am
by seokgi
The above Hex file works very well.

However, FC8 does not work.

External Clock changed 11.0592mHz.

Re: 18F67K40 UART Problem

Posted: Thu Aug 01, 2019 2:51 pm
by Lagoda
OK.
Then you are sure that your circuit is not faulty.

Have you ever tried to set the HighVoltage programming mode in Configuration Settings? (This is now set to LV in your test program.)
What type of programming tool do you use?

Lagoda

Re: 18F67K40 UART Problem

Posted: Fri Aug 02, 2019 1:37 am
by seokgi
I have never tried high voltage programming.

And I use PICKIT3.

Thank you for your attention.

Re: 18F67K40 UART Problem

Posted: Fri Aug 02, 2019 7:13 am
by Lagoda
I mean, try to disable the Low Voltage Programming mode. Sorry.

Re: 18F67K40 UART Problem

Posted: Fri Aug 02, 2019 2:38 pm
by LeighM
When you tried V0.9.fcfx (attached above, but with the lower frequency clock/crystal) with the LED icons enabled, did the LEDs flash?

Re: 18F67K40 UART Problem

Posted: Fri Aug 02, 2019 4:09 pm
by Benj
Hello,

I have never tried high voltage programming.


Low voltage programming (LVP) IMO is a can of worms and best avoided at all costs if possible. Make sure you disable it in your configuration settings. PICkit via ICSP will use high voltage programming by default.

Best way to start debugging your hardware is to try this. It will confirm your device is running and if the UART baud rate has a chance of being correct.
https://www.matrixtsl.com/wiki/index.ph ... ED_flasher

Re: 18F67K40 UART Problem

Posted: Mon Aug 05, 2019 12:56 am
by seokgi
Crystal was replaced with 11.0592mHz.
I have confirmed that the program that flashes works.
The UART still does not work.
And how does RE3 and RG5 differ from the 18F67K40? RE3 works well as an output.

Re: 18F67K40 UART Problem

Posted: Mon Aug 05, 2019 3:39 am
by seokgi
seokgi wrote:Crystal was replaced with 11.0592mHz.
I have confirmed that the program that flashes works.
The UART still does not work.
And how does RE3 and RG5 differ from the 18F67K40? RE3 works well as an output.


18LF67K40.fcdx is suspected.

Thank you.

Re: 18F67K40 UART Problem

Posted: Tue Aug 06, 2019 3:12 pm
by Lagoda
Have you ever tried in your test enviroment to use only one UART component without LED components?

Lagoda

Re: 18F67K40 UART Problem

Posted: Tue Aug 06, 2019 11:57 pm
by seokgi
Yes .
I tried it. But does not work.

Re: 18F67K40 UART Problem

Posted: Wed Aug 07, 2019 12:23 am
by seokgi
I used the updated 18LF67K40.fcdx but uart still doesn't work. LED works well. The timer interrupt does not work either.

Re: 18F67K40 UART Problem

Posted: Wed Aug 07, 2019 5:22 am
by QMESAR
HI,
I would change the configuration settings for PPS from allow once to allow as needed

P1.jpg
P1.jpg (120.19 KiB) Viewed 2356 times


P2.jpg
P2.jpg (104.91 KiB) Viewed 2356 times

Re: 18F67K40 UART Problem

Posted: Thu Aug 08, 2019 12:02 am
by seokgi
I ran as you advised but it still doesn't work.
  ~ MCLR doesn't seem to be related to RE3, but requires configuration in Project Options.
I don't know how to deal with the PCB already produced.
Thank you for your attention.

Re: 18F67K40 UART Problem

Posted: Thu Aug 08, 2019 5:13 am
by QMESAR
Hi.
well I am not sure what is going on here however in my understanding of the Datasheet MCLR is at pin RG5 and not RE3 as in the FC definition file and it seems one UART is using RE3

P1.jpg
P1.jpg (75.38 KiB) Viewed 2326 times

Re: 18F67K40 UART Problem

Posted: Thu Aug 08, 2019 6:19 am
by seokgi
I think the same thing. I'm waiting for a quick fix from Matrix.
thank you.

Re: 18F67K40 UART Problem

Posted: Fri Aug 09, 2019 12:31 am
by seokgi
When will this problem be solved?
I hope you're interested in Matrix.

Re: 18F67K40 UART Problem

Posted: Mon Aug 12, 2019 11:57 am
by seokgi
Hi.
Benj.
When will this problem be solved? I can't do anything.
If this doesn't work, I'm in serious trouble. PCB is produced. Give a solution
Please help me.
Thank you.

Re: 18F67K40 UART Problem

Posted: Mon Aug 12, 2019 12:33 pm
by Benj
Hello,

So we are on the same lines what exactly isn't working that you would like me to investigate.

From the looks of it UART comms is not working and timer interrupts are also not working? Is this correct?


Just been through the chip definition and both Timer0 and Timer1 look ok.

I've also been through the UART CAL comparing the register setup with a known working device and this also checks out.

So I'll wait for you to confirm the specific issue you've experienced.


In your project you have all AltTx and AltRx properties set to Yes, what happens if you set these to No.