12F1840 UART interrupt ?

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

Moderator: Benj

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

12F1840 UART interrupt ?

Post by seokgi »

Hi. Everyone.

I worked 12F1840 with ds1307. I wanna clock to UART. But UART INT is not work. I don't solve.

Please Help me.

Thank you
Attachments
test].fcfx
(10.03 KiB) Downloaded 150 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 12F1840 UART interrupt ?

Post by medelec35 »

Within your interrupt macro, you have got a SendString rather than ReceiveString.
So nothing will be assigned to UART_Recive1 as your're not using that value anyway.

Martin
Martin

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

Re: 12F1840 UART interrupt ?

Post by seokgi »

Thanks your answer.

I did a program to resend the data I received to confirm that the data sent from the pc to the pic was cleaned,

but the data would not come back. I do not know what I did wrong. I suspect that the interrupt is not working properly.
Attachments
test1.fcfx
(10.38 KiB) Downloaded 159 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 12F1840 UART interrupt ?

Post by medelec35 »

Hi seokgi,
I have noticed you have RS232 in software mode.
The RX interrupt with only work in hardware mode, so you will need to select

Code: Select all

Channel 1
Also I would not recommend delays within interrupt.
Another thing wrong was Enable interrupt component was within your main loop.
Interrupt enable should only be accessed once.

Can you try the attached flowchart.

Martin
Attachments
test2.fcfx
(10.84 KiB) Downloaded 171 times
Martin

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

Re: 12F1840 UART interrupt ?

Post by seokgi »

Thank you.
I fully understood your advice.
However, APFCON error occurs when I execute it.

Target folder: D:\Work\Study\Flowcode\DS1307
Source name: D:\Work\Study\Flowcode\DS1307\test2.fcfx
Title:
Description:
Device: PIC.12F.12F1840
Generated by: Flowcode v7.3.0.7
Date: Friday, May 11, 2018 00:21:25
Users: 1
Registered to: seokgi
Licence key: HNMEMM
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Microchip\xc8\v1.45\bin\xc8.exe --chip=12F1840 "test2.c" --MSGDISABLE=359,1273,1388
Microchip MPLAB XC8 C Compiler (Free Mode) V1.45
Build date: Nov 15 2017
Part Support Version: 1.45
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Init_1()
370: APFCON = APFCON | ();
^ (195) expression syntax
373: APFCON = APFCON | ();
^ (195) expression syntax
(908) exit status = 1
(908) exit status = 1

C:\Program Files (x86)\Microchip\xc8\v1.45\bin\xc8.exe reported error code 1



FINISHED

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: 12F1840 UART interrupt ?

Post by medelec35 »

There is a fix for that.
Just make a copy of 12F1840.fcdx within Flowcode 7\FCD\PIC\ directory, then replace it with fix LeighM posted here
You must click on Reload (or exit and restart Flowchart) for changes to take effect.
I have tested the flowchart I posted with hardware and I can confirm all working for me.

Martin
Martin

Post Reply