Pic16F1618 UART Remap

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

Moderator: Benj

Post Reply
User avatar
jollybv
Flowcode v5 User
Posts: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Pic16F1618 UART Remap

Post by jollybv »

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 67 times

User avatar
Benj
Matrix Staff
Posts: 14837
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: Pic16F1618 UART Remap

Post by Benj »

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 2525 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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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
(42.78 KiB) Downloaded 2375 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8874
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Pic16F1618 UART Remap

Post by medelec35 »

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.
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: 8874
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Pic16F1618 UART Remap

Post by medelec35 »

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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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
(38.76 KiB) Downloaded 2353 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8874
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Pic16F1618 UART Remap

Post by medelec35 »

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.
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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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: 8874
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Pic16F1618 UART Remap

Post by medelec35 »

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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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: 8874
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Contact:

Re: Pic16F1618 UART Remap

Post by medelec35 »

No problem,
I have moved topic to the V7 bugs section.
Out of curiosity,
Have you got the latest V7 update posted here?
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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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: 14837
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: Pic16F1618 UART Remap

Post by Benj »

Hello,

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

User avatar
jollybv
Flowcode v5 User
Posts: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

Hi Ben

Here is the program
Mini 2.fcfx
(17.2 KiB) Downloaded 56 times

User avatar
jollybv
Flowcode v5 User
Posts: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

Hi Ben

Were you able to find the fault?

User avatar
Benj
Matrix Staff
Posts: 14837
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: Pic16F1618 UART Remap

Post by Benj »

Hello,

When I load your project file into FC7 both the remap properties are empty.
Renao.jpg
Renao.jpg (47.95 KiB) Viewed 2214 times
Have you assigned these values in your project?

User avatar
jollybv
Flowcode v5 User
Posts: 360
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Contact:

Re: Pic16F1618 UART Remap

Post by jollybv »

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
(18.5 KiB) Downloaded 2076 times

Post Reply