18F67K40 UART Problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

18F67K40 UART Problem

Post 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.
Attachments
V0.9.fcfx
(20.76 KiB) Downloaded 207 times

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: 18F67K40 UART Problem

Post 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
Attachments
Quartz Crystal Operation.png
(26.97 KiB) Downloaded 2682 times

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

Thank you.
Circuit is working.
But uart is not work.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: 18F67K40 UART Problem

Post 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?

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post 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.

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: 18F67K40 UART Problem

Post 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
(12.59 KiB) Downloaded 2658 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.
Attachments
Seokgi.X.production.hex
(3.72 KiB) Downloaded 182 times

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

Unfortunately I do not know C Language.
Thank you for your interest.

I would like to have a deep interest in Matrix.

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

The above Hex file works very well.

However, FC8 does not work.

External Clock changed 11.0592mHz.

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: 18F67K40 UART Problem

Post 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

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

I have never tried high voltage programming.

And I use PICKIT3.

Thank you for your attention.

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: 18F67K40 UART Problem

Post by Lagoda »

I mean, try to disable the Low Voltage Programming mode. Sorry.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: 18F67K40 UART Problem

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F67K40 UART Problem

Post 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

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post 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.
Attachments
스크린샷 2019-08-05 08.52.04.png
(49.35 KiB) Downloaded 2509 times

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post 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.

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: 18F67K40 UART Problem

Post by Lagoda »

Have you ever tried in your test enviroment to use only one UART component without LED components?

Lagoda

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

Yes .
I tried it. But does not work.

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

I used the updated 18LF67K40.fcdx but uart still doesn't work. LED works well. The timer interrupt does not work either.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: 18F67K40 UART Problem

Post 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 9003 times

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

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post 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.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: 18F67K40 UART Problem

Post 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 8973 times

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

I think the same thing. I'm waiting for a quick fix from Matrix.
thank you.

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post by seokgi »

When will this problem be solved?
I hope you're interested in Matrix.

seokgi
Posts: 164
Joined: Fri Jan 13, 2012 4:21 am
Location: South KOREA
Has thanked: 18 times
Been thanked: 16 times
Contact:

Re: 18F67K40 UART Problem

Post 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.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 18F67K40 UART Problem

Post 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.

Post Reply