Hello,
In my new project I need to decode some bytes (with USART) and convert them to an anolog signal. I thought to use the 16f1823 because he has the USART and the DAC onboard.
But ! I'm unable to find how to use the DAC (located on RA0) with Flowcode...
Can someone give me an advice ?
Regards,
Bernard
using internal DAC of a 16f1823
Moderator: Benj
- 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: using internal DAC of a 16f1823
Hello Bernard,
Not sure if this will work but looks simple enough.
Pop this code in via a C icon to setup the DAC.
To shift down a 8-bit ADC reading to 5-bit you would do this in a calculation icon.
Then to control the voltage on the output you would do this where you have a Flowcode byte variable called adc.
Let me know how you get on.
Not sure if this will work but looks simple enough.
Pop this code in via a C icon to setup the DAC.
Code: Select all
daccon0 = 0xE0;
Code: Select all
adc = adc >> 3
Code: Select all
daccon1 = FCV_ADC;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: using internal DAC of a 16f1823
Hi Ben,
Just test compiled in Flowcode and seems to work !
Now just waiting after my Chip
Thanks !
Just test compiled in Flowcode and seems to work !
Now just waiting after my Chip
Thanks !
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9