18F67K40 UART Problem

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

Moderator: Benj

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Mon Aug 12, 2019 3:30 pm

Benj wrote: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?

Yes !! Collect.

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

It is not working.

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.

I tried UART changed pin number. But that is not working.
I don't know how change UART CAL.



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


Looks same problem.

Thank you.

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

Re: 18F67K40 UART Problem

Postby Benj » Mon Aug 12, 2019 3:43 pm

Hello,

Thanks for getting back to me. Let's start with the timers. Do you have a simple program to test the timers I can look at? Just in case you have anything specific in your program that is causing a problem. Which timers have you tried?

I'll have another pass through the generated code and the datasheet just to make sure I've not missed anything.

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Tue Aug 13, 2019 5:54 am

Thanks for the quick response
I send a program to test.
I tried changing the timer in Interval, but it still doesn't work. And UART doesn't work either. If you operate the UART pin with LED, it works well.
Thank you.
Attachments
V0.901.fcfx
(22.93 KiB) Downloaded 3 times

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

Re: 18F67K40 UART Problem

Postby Benj » Tue Aug 13, 2019 12:56 pm

Hello,

You are using the Heart macro for the timer interrupt and again inside your main loop.

Try this simple test instead, does this count up on the LED array, should be at approx 10Hz.

TimerTest.fcfx
(23.37 KiB) Downloaded 7 times

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Wed Aug 14, 2019 1:09 am

Thank you very much for your help.
I got a message that the versions are different, so I removed the FC8 and downloaded and installed it.
It works fine. However, UART and Interrupt does not work for Timer 2, Timer 4, Timer 6, and Timer 8.

thank you for helping.

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Fri Aug 16, 2019 9:17 am

Dear Benj
I search here every day. I am in a very difficult position.
I hope to resolve the UART issue soon.
If I can't solve it next Monday, I'll have to pay a penalty.
Please help me.
Thank you.

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

Re: 18F67K40 UART Problem

Postby Benj » Fri Aug 16, 2019 12:02 pm

Hello,

Right I believe I've fixed the timer 2, 4, 6, 8 issue now and pushed the update to the system.

Can you send us an example of your UART project and I'll have another look at this for you.

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Fri Aug 16, 2019 2:22 pm

Hi Benji!
The timer seems to be working well.

But the UART doesn't work at all.
Upload the test program.


Thank you.
Attachments
ComTest.fcfx
(24.08 KiB) Downloaded 2 times

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

Re: 18F67K40 UART Problem

Postby Benj » Fri Aug 16, 2019 3:49 pm

The UART registers look OK to me.

The device does allow you to disable the peripheral clock and also the UART modules via the PMD0 and PMD5 registers. However the default for these should be enabled.

You can check this will the following C code before you initialise the UARTs.

Code: Select all

PMD0 = 0;
PMD5 = 0;


Is anything coming out of the TX pin? e.g. if you connect a LED does it flash or stay lit? Do you have access to a scope? Maybe it's working but at the wrong baud?

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Fri Aug 16, 2019 4:12 pm

I changed the source as you advised, but the UART still doesn't work.

Thank you.
Attachments
ComTest.fcfx
(24.21 KiB) Downloaded 2 times
These users thanked the author seokgi for the post:
Benj (Fri Aug 16, 2019 4:41 pm)
Rating: 5.56%
 

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

Re: 18F67K40 UART Problem

Postby Benj » Fri Aug 16, 2019 4:40 pm

Have you tried a single UART at a time?

Also

Is anything coming out of the TX pin? e.g. if you connect a LED does it flash or stay lit? Do you have access to a scope? Maybe it's working but at the wrong baud?

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Sat Aug 17, 2019 1:19 am

Yes I tried it.

seokgi
Posts: 99
Joined: Fri Jan 13, 2012 4:21 am
Has thanked: 15 times
Been thanked: 10 times
Contact:

Re: 18F67K40 UART Problem

Postby seokgi » Sun Aug 18, 2019 2:12 am

Yes
I tried it, but the UART still doesn't work.
The TX port outputs nothing. I looked at scope but there is no output.
There is nothing wrong with the circuit. LED does not blink even if UART is operated one by one.


Thank you.