Page 1 of 1

Pic16F1618 UART Remap

Posted: Tue Nov 12, 2019 2:18 pm
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 269 times

Re: Pic16F1618 UART Remap

Posted: Tue Nov 12, 2019 5:58 pm
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 10510 times
Other then that maybe try a standard 1 second flasher test to confirm the chip is running at the specified speed.

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 7:47 am
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

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 10:36 am
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.

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 11:39 am
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?

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 2:10 pm
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

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 2:53 pm
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.

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 2:59 pm
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

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 3:38 pm
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.

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 5:02 pm
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

Re: Pic16F1618 UART Remap

Posted: Wed Nov 13, 2019 6:29 pm
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?

Re: Pic16F1618 UART Remap

Posted: Thu Nov 14, 2019 6:22 am
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

Re: Pic16F1618 UART Remap

Posted: Thu Nov 14, 2019 8:14 am
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

Re: Pic16F1618 UART Remap

Posted: Fri Nov 15, 2019 1:37 pm
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

Re: Pic16F1618 UART Remap

Posted: Fri Nov 15, 2019 1:48 pm
by Benj
Hello,

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

Re: Pic16F1618 UART Remap

Posted: Sat Nov 16, 2019 9:26 am
by jollybv
Hi Ben

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

Re: Pic16F1618 UART Remap

Posted: Thu Nov 21, 2019 6:44 am
by jollybv
Hi Ben

Were you able to find the fault?

Re: Pic16F1618 UART Remap

Posted: Fri Nov 22, 2019 11:35 am
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 10199 times
Have you assigned these values in your project?

Re: Pic16F1618 UART Remap

Posted: Sat Nov 23, 2019 9:47 am
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.