Hi Rob,
Which is the meaning of the word "ROJA" ? :)
thx,
Vasile

On Sat, Nov 28, 2020 at 9:04 AM Rob CJ <[email protected]> wrote:

> Hi Mike,
>
> I used a 10-bit DAC with PIC16F1765 in my Digital Controlled Power Supply:
> Digital Controlled Linear Power Supply : 6 Steps (with Pictures) -
> Instructables
> <https://www.instructables.com/Digital-Controlled-Linear-Power-Supply/>
>
> I used two functions.
>
> ; Initialize the 10-bit Digital to Analog Converter (DAC)
> procedure dac_init() is
>    ; Enable, right justified, output enable, use VDD as reference, VRef-
> to VSS.
>     DAC1CON0 = 0b1010_0000 ; VDD reference.
>     dac_set(MIN_DAC_VALUE) ; Output at minimum
> end procedure
>
> ; Write the given value to the 10-bit DAC.
> procedure dac_set(word in value) is
>    DAC1REF = value
>    DACLD_DAC1LD = TRUE
>    while DACLD_DAC1LD loop
>       ; Wait for DAC to complete transfer.
>    end loop
> end procedure
>
> This was a very fruitful project for JAL since I extracted two JAL
> libraries from it, one to control a digital potentiometer and one to write
> data into HEF (this PIC does not have EEPROM but HEF instead) 😊
>
> Hope this helps.
>
> Kind regards,
>
> Rob
>
>
> ------------------------------
> *Van:* 'Mike' via jallib <[email protected]>
> *Verzonden:* zaterdag 28 november 2020 03:37
> *Aan:* jallib <[email protected]>
> *Onderwerp:* [jallib] PIC16F1778 10-bit DAC, anyone?
>
> I'm trying to get the 10-bit DAC of the PIC16F1778 working and am not
> being successful.  Has anyone used this, or similar?  I'm scoping the
> output pin and getting nothing.  Below is my code.  Any push in the right
> direction is appreciated.
>
> Regards,
> Mike
>
>
> --
> include 16f1778                     -- target PICmicro
> --
> pragma target clock    8_000_000       -- oscillator frequency
> --
> pragma target OSC      INTOSC_NOCLKOUT           -- internal oscillator
> pragma target PLLEN    DISABLED                  -- PLL off
> pragma target CLKOUTEN DISABLED                  -- no clock output
> pragma target WDT      DISABLED                  -- watchdog off
> pragma target BROWNOUT DISABLED                  -- no brownout reset
> pragma target FCMEN    DISABLED                  -- no clock monitoring
> pragma target IESO     DISABLED                  -- no int/ext osc
> switching
> pragma target LVP      DISABLED                  -- low voltage
> programming off
> pragma target MCLR     INTERNAL                  -- internal reset
> --
> --
> OSCCON_SCS = 0                      -- select primary oscillator
> OSCCON_IRCF = 0b1110                -- 8 MHz
> OSCCON_SPLLEN = FALSE               -- software PLL off
> --
> enable_digital_io()                 -- make all pins digital I/O
> --
> LATA = 0
> LATB = 0
> LATC = 0
> TRISA = 0
> TRISB = 0
> TRISC = 0
>
> DAC1REFL = 0
> DAC1REFH = 0
> DAC1CON0 = 0b1010_0000 -- DAC on and output to the pin
> --
> var byte c = 0
> --
> forever loop
> for 255 using c loop
>     DAC1REFL = c
>     DACLD_DAC1LD = true
>     _usec_delay(100_000)
> end loop
> end loop
> --
>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jallib/58400326-e940-49be-894a-87edbc767a72n%40googlegroups.com
> <https://groups.google.com/d/msgid/jallib/58400326-e940-49be-894a-87edbc767a72n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jallib/AM0PR07MB62418356459EFBEB92A03B69E6F70%40AM0PR07MB6241.eurprd07.prod.outlook.com
> <https://groups.google.com/d/msgid/jallib/AM0PR07MB62418356459EFBEB92A03B69E6F70%40AM0PR07MB6241.eurprd07.prod.outlook.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/CAM%2Bj4qti51zVJ5G6Obd%3DRsepsXs9mbgP3f-pTRB1JVmZu9US9A%40mail.gmail.com.

Reply via email to