diff options
| author | Marti Bolivar <mbolivar@leaflabs.com> | 2011-02-18 05:26:24 -0500 | 
|---|---|---|
| committer | Marti Bolivar <mbolivar@leaflabs.com> | 2011-02-18 16:59:06 -0500 | 
| commit | 47aea07e43c5edded31211ce13a502db5501236a (patch) | |
| tree | 6604e637ab9ad462b68f05a68cf0ed8004b1a362 /notes | |
| parent | 0d440118bd4e1ba64f92d3636302fbddeac5bef6 (diff) | |
| download | librambutan-47aea07e43c5edded31211ce13a502db5501236a.tar.gz librambutan-47aea07e43c5edded31211ce13a502db5501236a.zip  | |
Trivial DAC-related updates.
Diffstat (limited to 'notes')
| -rw-r--r-- | notes/dac.txt | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/notes/dac.txt b/notes/dac.txt index d027402..e6c9b7b 100644 --- a/notes/dac.txt +++ b/notes/dac.txt @@ -35,6 +35,26 @@ time, as follows:  Buffering will be enabled by default. +HOWTOs +------------------------------------------------------------------------------- + +In order to generate a full-amplitude triangle wave: + +   - Make the following settings in dac->CR, for the DAC channel you +     want: set MAMP to 1011 (amplitude 4095), WAVE to 10 (triangle), +     TSEL to 111 (software trigger), TEN to 1 (trigger enabled), and +     EN to 1 (chanel enabled). + +   - Set dac->DHR12Rx to 0 (where x is your channel).  This gets added +     to the triangle wave value at each trigger step. + +   - Now, forever: set DAC_SWTRIGR_SWTRIGx in dac->SWTRIGR, and wait +     for it to get cleared by hardware. + +You can do something similar for noise (by setting WAVE to 01 +instead).  You can also cause the waves to advance due to timer events +or external line 9, by making appropriate settings to TSEL. +  TODO  -------------------------------------------------------------------------------  - sine wave demo using Timer interrupts  | 
