PIC16F1503

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

Moderator: Benj

Post Reply
JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

PIC16F1503

Post by JUZAR »

Hi Sir,

Kindly advise whether flowcode 6 support PIC16F1503. If not is there any substitute or indirect way to design a flow chart using PIC16F1503

Awaiting your reply at the earliest.

Regards.

Juzar.

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

Re: PIC16F1503

Post by Benj »

Hello,

The PIC16F1503 appears to be in the supported device list for v6.

Are you havign a problem comppiling?

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Thanks for your quick response.

Still not compiled, but wanted to confirm whether this device is supported by V6. I checked again in "Project Options " and is supported by V6.

Thanks

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Dear Sir,

There is an issue in using PIC16F150X devices. In flowcode 6 when I am trying to select target device PIC16F1504 in project options the pin count is 14, while when selecting target device with higher memory devices like PIC16F1507 - 09 its displaying 20 pin device. In Microchip data sheet all the devices are 14 pin. Can you please assist me how to solve this issue. My requirement is of PIC16F1509 with 14 pin, but cannot use it because flowcode6 is not displaying correct pin count.

Regards.

Juzar.

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

Re: PIC16F1503

Post by Benj »

Hello Juzar,

I beleive the pin count is correct.

1:DS40001615 PIC12(L)F1501 Data Sheet, 8-Pin Flash, 8-bit Microcontrollers.
2:DS40001607 PIC16(L)F1503 Data Sheet, 14-Pin Flash, 8-bit Microcontrollers.
3:DS40001586 PIC16(L)F1507 Data Sheet, 20-Pin Flash, 8-bit Microcontrollers.
4:DS40001609 PIC16(L)F1508/9 Data Sheet, 20-Pin Flash, 8-bit Microcontrollers.

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Thanks Benj.

Yes I rechecked the data sheet, you are correct

Regards.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PIC16F1503

Post by Steve001 »

Hello Juzar,

I did an excel chip list a while ago (For V6) this may be of help to find a device, the list dose list some high pin counts.

https://www.matrixtsl.com/mmforums/view ... 835#p69835

Hope this helps you with future projects

Steve
Success always occurs in private and failure in full view.

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Hi Sir,

I was just implementing seven segment multiplexing as per attached file. I made a flowchart for 1st digit using V6. The simulation works OK by displaying digit 0 to 9 when potentiometer is moved from 0 V to 5 V, but when I am trying to run this on actual circuit the 7 segment displays 0-5 digit correctly but after that it just displays decimal digit only while 6-9 digits are not displayed. Can you please assist what could be the issue. Kindly note that other two digits are presently not used. Actual display and simulation display are both common anode type. The refresh period counter for simulation used is 5, but in actual circuit the counter is set such that it gives 5 mill seconds refresh period
Attachments
3 Individual Digit Voltmeter 24 V.fcfx
(13.05 KiB) Downloaded 251 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: PIC16F1503

Post by medelec35 »

Hi
I would recommend controlling 7Seg displays like this
I would suggest looking at 7Segment Timer demo and changing it into the voltmeter you are after.
If you are stuck, I can help you further.
Martin

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Thanks you Sir,

I will try again and if any issue will post my questions.

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

medelec35 wrote:
Wed Nov 25, 2020 9:33 pm
Hi
I would recommend controlling 7Seg displays like this
I would suggest looking at 7Segment Timer demo and changing it into the voltmeter you are after.
If you are stuck, I can help you further.
----------------------------------------------------------------------------------------------------------------------------
Hi Sir,

As per your suggestions I tried controlling display and its perfectly counting 0-9, so this means the hardware is correct. After that I tried multiplexing 3 seven segment LED display as per attached V6 flowchart. In simulation the segments are correctly displaying, but in actual circuit its displaying 000 constantly and while counter is increment each second.
Kindly assist me what could be missing in this.
Regards.
Juzar
Attachments
7Seg_Test2 Multiplex.fcfx
(10.74 KiB) Downloaded 237 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: PIC16F1503

Post by medelec35 »

Hi Juzar you have missed this in Main:
Using MOD.png
Using MOD.png (2.01 KiB) Viewed 11774 times
So you will need an individual variable for each digit.
I would not recommend placing the the MOD calculations within the timer interrupt.
The MOD function works by extracting the remainder after a division.
In this case it's used to extract hundreds , tens and units from the count variable.
For example is the count value is = 123 then:

Code: Select all

dig0 = count % 10  = 3
dig1 = (count / 10) % 10 = 2
dig2 = (count / 100) % 10 = 1 
The other important issue to resolve is don't have your timer 0 interrupt prescaler on 1:1.
It will vastly affect the delay timing.
In your case 1:4 should suffice.
You may even be better using the timer interrupt for a delay rather than a delay icon.
Martin

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

medelec35 wrote:
Sat Nov 28, 2020 12:13 pm
Hi Juzar you have missed this in Main:Using MOD.png
So you will need an individual variable for each digit.
I would not recommend placing the the MOD calculations within the timer interrupt.
The MOD function works by extracting the remainder after a division.
In this case it's used to extract hundreds , tens and units from the count variable.
For example is the count value is = 123 then:

Code: Select all

dig0 = count % 10  = 3
dig1 = (count / 10) % 10 = 2
dig2 = (count / 100) % 10 = 1 
The other important issue to resolve is don't have your timer 0 interrupt prescaler on 1:1.
It will vastly affect the delay timing.
In your case 1:4 should suffice.
You may even be better using the timer interrupt for a delay rather than a delay icon.
Hi Martin

Thanks for your quick reply,
Yes your suggestion is correct, but I had intentionally not used MOD calculations for simplification. Presently I am struggling with the numbers not displayed at all on actual circuit even though counter is incrementing every seconds, while simulation is perfectly displaying numbers on computer screen.

Though counter increases from 0-9, the number freezes to 0 0 0 on all three digits. The simulation is working perfectly but when I download the program on the chip the actual circuit digits displays 0 0 0 with no increment from 0 - 1 - 2 - 3 - 4.....
In order to simplify I have used "count" for all digits, so all three digits should display same number incrementing every second in multiplexing.

Thanking you and awaiting your feedback at the earliest.

Juzar

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: PIC16F1503

Post by medelec35 »

Hi Juzar,
You're welcome.
JUZAR wrote:
Sun Nov 29, 2020 4:54 am
Though counter increases from 0-9, the number freezes to 0 0 0 on all three digits.
You must have a hardware issue, as your code Works on my hardware.
Only difference is I'm using a PIC16F1937 which should make no difference to the outcome
All three of my displays count from 0 to 9 then A to F as you can't display two digits in the one display.
The issue you have is your hardware will keep resetting.
You must go into Build, Project options, Configure tab and change Watchdog Timer Enable to Disabled.
While you are in the configuration settings, change Low voltage programming from enabled to disabled as well, otherwise you will loose one of the port B pins.
Also your hardware will not be running at the correct osc speed!
With a new project, as a first step always test hardware is running at the correct speed.
You can do that by running a 1 sec flash test
Looking at page 59 of the PIC16F1503 datasheet, the default internal osc speed is 500kHz.
Therefore your hardware is running 16 times slower, so will take a long time to change from 0 seconds to 1,
To correct that, place a C icon at the very top, so its the first icon to be accessed
Then place in it

Code: Select all

osccon=0x70;
After that try the flash test.
Also don't forget to change the interrupt setting.
Another option is to change the clock setting to 16MHz and use a C code bock with

Code: Select all

osccon=0x80;
That will allow a faster timer interrupt speed when changed from 1:1.
Martin

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Thanks Martin

Its working, As per your advise..... disabled - Watchdog timer enable bit in project options which was was continuously re-setting the processor and included C code on the top which changed the numbers as per defined delay.

Thanking you again

Regards.

Juzar.

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Hi Martin.

As per our last correspondence, moving further I have added a potentiometer to read analogue values. MOD calculation used to display individual digits. But it seems I am still missing something to get it displayed. In the screen shot attached with his message In calculation icon when I write Digit1=1, Digit2=2 & Digit3=3 then its displaying correctly, but when I add MOD calculations for all three digits the display behaves abnormal by displaying unknown characters, blanks apart from know numbers and freezes. While simulation is working perfectly. Need your assistance to understand what could be this issue.

Regards.

Juzar.
Attachments
Screenshot (9).png
Screenshot (9).png (213.35 KiB) Viewed 11703 times
Screenshot (8).png
Screenshot (8).png (192.66 KiB) Viewed 11703 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: PIC16F1503

Post by medelec35 »

Hi Juzar,
Glad you are getting further.
Thanks for letting us know.
It's not easy to follow screen shots to see what's going on.
Can you post your flowchart and I will take a look at it when I home from work,
Martin

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Hi Martin

As advised from you, please see attached flowchart file.

Regards.

Juzar
Attachments
Voltage Monitor.fcfx
(12.9 KiB) Downloaded 189 times

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Hi Martin,

Hope you might have gone through flowchart which I had posted in last week. Meanwhile I am still struggling to resolve that issue. One thing I noted is during 50 Hz simulation, even though its reading the potentiometer value the INTVOLT register is not updated, it remains zero. This means that it will not do further calculations and update DIGIT1,2,3 registers also. This is something I cannot understand. Either there is some serious timing mismatch or there is some bug in FC6. Request your kindly look in to this and advise.

Regards.

Juzar.

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: PIC16F1503

Post by medelec35 »

Hi Juzar,
Please bare in mind that Flowcode 6 was released in September 2013 is no longer supported.
Just had a look at your flowchart.
If you look at your calculations, you have got multiply instead of division:

Code: Select all

Digit2 = (Voltage * 10) % 10
Digit3 = (Voltage * 100) % 10
It should be in this format.
You have three 7seg displays and the calculations for the displays will be based on hundreds tens and units.
So if the voltage result is 10.8, you will only see 10.
Another example if the voltage is less than 1 you will only see 0.
The solution will be to multiply the voltage result by 10 & use a decision branch to make sure the decimal point shows in the correct place.
What I would also recommend you do is test with a fixed Voltage calculation.
E.g Voltage = 123 & try Voltage = 12.3
That will make sure your 7seg displays are configured correctly.
If you are still getting 0 for the voltage value, then you could have an an issue with ADC assignment.
Have you assigned flowchart ADC to corrisponding ADC on hardware?
Martin

JUZAR
Posts: 53
Joined: Wed Feb 25, 2015 1:31 pm
Has thanked: 15 times
Been thanked: 4 times
Contact:

Re: PIC16F1503

Post by JUZAR »

Thanks Martin.

I will implement your suggestions.

Regards.

Juzar.

Post Reply