18F67K40 UART Problem
Moderator: Benj
-
- 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
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.
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 219 times
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: 18F67K40 UART Problem
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
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
- 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
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?
Do you have an oscilloscope to check?
The clock speed in Project Options looks odd, is it correct?
-
- 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
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.
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.
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: 18F67K40 UART Problem
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. 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.
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. 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 196 times
-
- 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
Unfortunately I do not know C Language.
Thank you for your interest.
I would like to have a deep interest in Matrix.
Thank you for your interest.
I would like to have a deep interest in Matrix.
-
- 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
The above Hex file works very well.
However, FC8 does not work.
External Clock changed 11.0592mHz.
However, FC8 does not work.
External Clock changed 11.0592mHz.
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: 18F67K40 UART Problem
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
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
-
- 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
I have never tried high voltage programming.
And I use PICKIT3.
Thank you for your attention.
And I use PICKIT3.
Thank you for your attention.
- 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
When you tried V0.9.fcfx (attached above, but with the lower frequency clock/crystal) with the LED icons enabled, did the LEDs flash?
- 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
Hello,
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
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.I have never tried high voltage programming.
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- 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
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.
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
-
- 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
18LF67K40.fcdx is suspected.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.
Thank you.
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: 18F67K40 UART Problem
Have you ever tried in your test enviroment to use only one UART component without LED components?
Lagoda
Lagoda
-
- 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
I used the updated 18LF67K40.fcdx but uart still doesn't work. LED works well. The timer interrupt does not work either.
- QMESAR
- 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
HI,
I would change the configuration settings for PPS from allow once to allow as needed
I would change the configuration settings for PPS from allow once to allow as needed
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- 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
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.
~ 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.
- QMESAR
- 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
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
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
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
-
- 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
I think the same thing. I'm waiting for a quick fix from Matrix.
thank you.
thank you.
-
- 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
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.
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.
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel