Pic16F1618 UART Remap

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Pic16F1618 UART Remap

Postby jollybv » Tue Nov 12, 2019 2:18 pm

Hi Guys
I'm trying to get the RS232 TX to send data on the PIC16F1618 SSOP 20 pin but can't seem to get it right. If I do a simulation it sends the data out on the coms port but when I try it in the chip nothing not sure what I'm doing wrong.

Mini 2.fcfx
(14.48 KiB) Downloaded 18 times

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

Re: Pic16F1618 UART Remap

Postby Benj » Tue Nov 12, 2019 5:58 pm

Hello,

In your configuration settings you have Low Voltage Programming Enabled - Please change this to Disabled.

You wight also want to change the PPSLOCK item so that it is Enabled.

The Watchdog timer is also enabled, I would maybe disable this until you're happy things are working ok.

Config.jpg
Config.jpg (130.27 KiB) Viewed 593 times


Other then that maybe try a standard 1 second flasher test to confirm the chip is running at the specified speed.

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Wed Nov 13, 2019 7:47 am

Hi Ben

Thanks for the reply I did the 1s puls when I set the clock speed to 32Mhz internal, that all seemed to work. I have also changed the settings as you suggested but still nothing. Is there anything else I can try.

Config.PNG
Config.PNG (42.78 KiB) Viewed 573 times
These users thanked the author jollybv for the post:
Benj (Wed Nov 13, 2019 11:15 am)
Rating: 5.26%
 

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Pic16F1618 UART Remap

Postby medelec35 » Wed Nov 13, 2019 10:36 am

If the 1sec flash test is ok,
Have you tried moving send string function to before the decision branch to eliminate connection issues?
Do you have a scope or logic analyser?
If no then this is what I do if terminal not displaying correct text.
These users thanked the author medelec35 for the post:
Benj (Wed Nov 13, 2019 11:15 am)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Pic16F1618 UART Remap

Postby medelec35 » Wed Nov 13, 2019 11:39 am

I have moved this topic from the "Tips and Tricks" section as that is meant for sharing your knowledge
Not for starting off with asking questions.

Another thing I have thought of.
Can you measure the voltage on the TX output whilst sending data and not sending data?
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Wed Nov 13, 2019 2:10 pm

Hi Martin

I have tried putting the send string straight after the UART initialize in a loop with a 1-second delay but still nothing. I have also hooked the scope up but can't measure any voltage only noise 250mv. and even hooked up a USB to RS232 converter that does not even give me gibberish. I dont know where to go from here. The pin I'm using is RA2 I have also tried RB7, also switched RA2 high low high low to see if it was working.

Scope reading.PNG
Scope reading.PNG (38.76 KiB) Viewed 551 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Pic16F1618 UART Remap

Postby medelec35 » Wed Nov 13, 2019 2:53 pm

Hi Brian,
Just wanted to make sure as much is covered as possible.

So long as you have checked you are using the latest version (8.2.1.14), sounds like you have gone as far as you can go.
This possibly requires a fix from Martix.
These users thanked the author medelec35 for the post:
jollybv (Wed Nov 13, 2019 3:16 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Wed Nov 13, 2019 2:59 pm

Thanks Martin

I think there is a problem with the PIC16F1618 component as it won't work in software mode as well i get the followin error

C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_UART.c:
206: #error "Software UART Baud Rate Not Available At This Clock Speed"
(103) #error: "Software UART Baud Rate Not Available At This Clock Speed" ^
(908) exit status = 1
(908) exit status = 1

Have changed the from 32Mhz to 4Mhz still same problem

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Pic16F1618 UART Remap

Postby medelec35 » Wed Nov 13, 2019 3:38 pm

jollybv wrote:C:\Program Files (x86)\Flowcode 7\CAL\PIC\PIC_CAL_UART.c:

Woops, Thought you was using V8, sorry.
jollybv wrote:206: #error "Software UART Baud Rate Not Available At This Clock Speed"

Software mode has limitations and is not as good as hardware mode.
I don't believe that is a bug as 115200 in software mode is too fast, 38400 is the maximum you can have.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Wed Nov 13, 2019 5:02 pm

Hi Martin

Thanks again I have got it to work at 9600 in software but I will need to resolve the Chanel 1 with Matrix as the board I'm talking to runs at 115200

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Pic16F1618 UART Remap

Postby medelec35 » Wed Nov 13, 2019 6:29 pm

No problem,
I have moved topic to the V7 bugs section.
Out of curiosity,
Have you got the latest V7 update posted here?
These users thanked the author medelec35 for the post:
jollybv (Thu Nov 14, 2019 5:07 am)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Thu Nov 14, 2019 6:22 am

Hi Martin

I did not have the latest updates have loaded, will give it a try a bit later and let you know

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Thu Nov 14, 2019 8:14 am

Hi Martin

I have tried using the channel 1 UART after updating but still, does not work so I will need to wait for the flowcode guys to help

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Fri Nov 15, 2019 1:37 pm

Hi, Guys
Does anyone know how to solve the UART problem I have on The PIC16F1618 as I have tried everything and nothing works the only thing I can get to work is software UART at 9600

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

Re: Pic16F1618 UART Remap

Postby Benj » Fri Nov 15, 2019 1:48 pm

Hello,

Can you send us your latest test program and I'll try and investigate for you.

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Sat Nov 16, 2019 9:26 am

Hi Ben

Here is the program

Mini 2.fcfx
(17.2 KiB) Downloaded 12 times

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Thu Nov 21, 2019 6:44 am

Hi Ben

Were you able to find the fault?

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

Re: Pic16F1618 UART Remap

Postby Benj » Fri Nov 22, 2019 11:35 am

Hello,

When I load your project file into FC7 both the remap properties are empty.

Renao.jpg
Renao.jpg (47.95 KiB) Viewed 282 times


Have you assigned these values in your project?

User avatar
jollybv
Flowcode v5 User
Posts: 342
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 77 times
Been thanked: 24 times
Contact:

Re: Pic16F1618 UART Remap

Postby jollybv » Sat Nov 23, 2019 9:47 am

Hi Ben

Yes I have but as soon as I select Channel 1 the Uart does not work anymore at any speed i can only use the software at 9600.
Attachments
Uart 1.PNG
Uart 1.PNG (18.5 KiB) Viewed 274 times