Can you change the internal PWM default output pin?

For general Flowcode discussion that does not belong in the other sections.
Post Reply
canary_wharfe
Posts: 78
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Can you change the internal PWM default output pin?

Post by canary_wharfe »

Run into a real snag. I need to use a PIC24FV16KM102 device (5V) but the Flowcode device pin out is for the PIC24F16KM102 (3.3V) version component. The default PWM pin for the 3.3V device is pin20 OC1A (RA6). The snag is there is no RA6 pin on the 5V version of the chip. The OC1A pin on the PIC24FV16KM102 (5V) is pin 16 RB7.

Is there any way to change the component flowcode file for the PWM function? There doesn't seem to be any way of adding an alternative pin in the built in, internal PWM properties dialogue box. Am I forced to use the 3.3V chip?
regards etc.

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Can you change the internal PWM default output pin?

Post by BenR »

Hello,

I'm a bit confused by this it looks like currently we don't support any of the KM devices? Which definition file are you currently using?

If you're using a different definition file then you may simply be able to edit the file by copying and pasting the address here into your file explorer and editing the PWM section of the definition file in a text editor.

C:\ProgramData\MatrixTSL\FlowcodeV9\FCD\PIC16

e.g. here is the PWM section of the 24F16KA102 definition file.

Code: Select all

    <pwm>
    	<timer>
    	    <option name='Timer2' value='2' />
    	    <option name='Timer3' value='3' />
    	</timer>
        <prescaler >
            <option name='1' value='0' />
            <option name='8' value='1' />
            <option name='64' value='2' />
            <option name='256' value='3' />
        </prescaler>
        <out port='0' pin='6' />
    </pwm>
Just change this line.

Code: Select all

        <out port='0' pin='6' />
To

Code: Select all

        <out port='1' pin='7' />
The devices look to be supported by the compiler and so I'll get them on the list to be added.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: Can you change the internal PWM default output pin?

Post by canary_wharfe »

Thanks Ben

Sorry for the confusion. Yes I am using the flowcode 24F16KA102 device in my project. I called it KM because that is the version available from Microchip at the moment. The KA is really hard to get as so many chips are on 18+ month lead times even for hobbyist quantities. I'll edit the PWM section of the definition files (after making a backup) as you illustrated above. And yes it would be great to get the KM chips on the list as they seem more readily available.

Post Reply