I have a16F1776 with 5 and 10 bit DAC capability, but i didn't find any DAC info in the GCB docs. Am I missing something, or does GCB not have DAC support in it yet (beyond manually coding it in assembly)?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had a similar situation with the 12f1571 chip that I recently got. Still working with 0.94 (4/2/2015), and grabbed the chipdata file from trunk and dropped it in. So far, so good. To get the 16f1776 file, go to the code in the toolbar above on this webpage, then GCBASIC/TRUNK/CHIPDATA/16F1776 and download it then copy paste into your existing chipdata file.
Trying out new chip files is a good thing for the adventuresome type, as it may expose inconsistancies with the libraries which will give good feedback. Or, prove out to be compliant which means everything is still on track.
As far as the DAC module goes, manual setup of the registers is required, fairly simple operation. Same goes for the FVR module, and other less common ones. No assembly code required, just some simple initialization usually does it.
DACCON0 = b'10100000'
DACCON1 = b'00000111'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Further to the question. Great Cow Basic does not have high level support for DAC.
However, as Kent suggested it is a rather straight forward process to set it up. With the chip Datasheet in hand, setting it up is a matter of setting the bits in the related registers. Once you have it figured out it would be simple enough to create your own DAC related commands for your chip and application with subs/functions/macros or defines.
If you are attempting to use the DAC to generate a waveform such as a sine wave then then you will need to develop your own code for that. Microchip is a good resource for ideas. There are application notes on using the DAC for various purposes. While the applications notes may provide examples in ASM or C, once you understand the method, developing code in GCB is rather easy.
On another note.
The 16(L)F177x Series Chips are not (yet?) supported by the Pickit 2 Programmer (or K150?).
You will probably need to use MPLAB IPE/Pickit3 to program these
Last edit: William Roth 2016-06-15
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a16F1776 with 5 and 10 bit DAC capability, but i didn't find any DAC info in the GCB docs. Am I missing something, or does GCB not have DAC support in it yet (beyond manually coding it in assembly)?
What version? I am assuming this is the very latest build.
I downloaded and installed the latest version today. I do not see a file for that chip, either, but that hopefully will be added in a later build.
You should be ok to take the latest chip file from trunk.
I had a similar situation with the 12f1571 chip that I recently got. Still working with 0.94 (4/2/2015), and grabbed the chipdata file from trunk and dropped it in. So far, so good. To get the 16f1776 file, go to the code in the toolbar above on this webpage, then GCBASIC/TRUNK/CHIPDATA/16F1776 and download it then copy paste into your existing chipdata file.
Trying out new chip files is a good thing for the adventuresome type, as it may expose inconsistancies with the libraries which will give good feedback. Or, prove out to be compliant which means everything is still on track.
As far as the DAC module goes, manual setup of the registers is required, fairly simple operation. Same goes for the FVR module, and other less common ones. No assembly code required, just some simple initialization usually does it.
Further to the question. Great Cow Basic does not have high level support for DAC.
However, as Kent suggested it is a rather straight forward process to set it up. With the chip Datasheet in hand, setting it up is a matter of setting the bits in the related registers. Once you have it figured out it would be simple enough to create your own DAC related commands for your chip and application with subs/functions/macros or defines.
If you are attempting to use the DAC to generate a waveform such as a sine wave then then you will need to develop your own code for that. Microchip is a good resource for ideas. There are application notes on using the DAC for various purposes. While the applications notes may provide examples in ASM or C, once you understand the method, developing code in GCB is rather easy.
On another note.
The 16(L)F177x Series Chips are not (yet?) supported by the Pickit 2 Programmer (or K150?).
You will probably need to use MPLAB IPE/Pickit3 to program these
Last edit: William Roth 2016-06-15