Hello,
I would like to use the PIC16F1779 MCU in a new project.
According to the Microchip datasheet, it has 4 10-bit DACs and 4 5-bit DACs.
I want to use the 10-bit DACs, but they only appear as 8-bit DACs in Flowcode.
(Note: The 5-bit DACs all have their outputs routed to the B2 port pin, and I can't change this in the "Properties" window.)
The MCU also has 4 10-bit PWMs and 4 16-bit PWMs that I also want to use, but I can only access 2 8-bit channels in Flowcode at the moment.
Is it possible to fix this so that these Component Macros work with the parameters according to the datasheet?
Regards,
Sasi
PIC16F1779 DAC and PWM problem
-
- Posts: 110
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 02, 2020 12:11 pm
- Has thanked: 38 times
- Been thanked: 14 times
-
- Matrix Staff
- Posts: 1994
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 630 times
- Been thanked: 666 times
Re: PIC16F1779 DAC and PWM problem
Hello.
This needs looking into since the maximum number of DAC's is currently 4 so even if all the pins are correct, only the first 4 will work.
This device has a funny register for CCP as that's what we currently use for PWM.
it goes CCP1, CCP2, CCP7 & CCP8
The way Flowcode address the CCP registers is based on Channel selection within properties.
If Channel three is selected then the 3 is used for register e.g. CCP3CON, CCPR3L etc.
Of course they don't exist so there will be errors on compiling.
I will see if I can sort, this but it won't be today.
Attached a modified fcdx file that will hopefully address the first 4 DACs.
I have not got the hardware, so unable to test.
For the fcdx file:
If you browse to this location using File Explorer, it's hidden by default so just paste the link into your address bar.
Replace the original file with the attached version.
If Flowcode is already open, then you will need to reload your project.
If you run any component updates, then the fcdx you added will be overwritten.
This needs looking into since the maximum number of DAC's is currently 4 so even if all the pins are correct, only the first 4 will work.
This device has a funny register for CCP as that's what we currently use for PWM.
it goes CCP1, CCP2, CCP7 & CCP8
The way Flowcode address the CCP registers is based on Channel selection within properties.
If Channel three is selected then the 3 is used for register e.g. CCP3CON, CCPR3L etc.
Of course they don't exist so there will be errors on compiling.
I will see if I can sort, this but it won't be today.
Attached a modified fcdx file that will hopefully address the first 4 DACs.
I have not got the hardware, so unable to test.
For the fcdx file:
If you browse to this location using File Explorer, it's hidden by default so just paste the link into your address bar.
Code: Select all
%ProgramData%\MatrixTSL\FlowcodeV10\FCD\PIC\
If Flowcode is already open, then you will need to reload your project.
If you run any component updates, then the fcdx you added will be overwritten.
- Attachments
-
- 16F1779.fcdx
- (24.27 KiB) Downloaded 3 times
Martin
Re: PIC16F1779 DAC and PWM problem
Hi Martin!
Thanks for your answer.
I'm expecting the microcontrollers by the middle of next week, so I can't test the peripherals on hardware yet.
I just tried to see if Flowcode would be a suitable development environment for this MCU.
That's how I found these oddities.
Regards,
Sasi
Thanks for your answer.
I'm expecting the microcontrollers by the middle of next week, so I can't test the peripherals on hardware yet.
I just tried to see if Flowcode would be a suitable development environment for this MCU.
That's how I found these oddities.
Regards,
Sasi
Re: PIC16F1779 DAC and PWM problem
I forgot to write that I will of course give feedback on the operation of your modifications as soon as the chips arrive.
I replaced the 16F1779.fcdx file and now DAC channels 1, 2, 5, 6 appear as 10-bit in the "Properties" window.
Thanks again.
I replaced the 16F1779.fcdx file and now DAC channels 1, 2, 5, 6 appear as 10-bit in the "Properties" window.

Thanks again.