Designing Mobile Robot Interfaces with 16-bit Microchip Microcontrollers by Ahmet Bindal
Author:Ahmet Bindal
Language: eng
Format: epub
ISBN: 9783031278419
Publisher: Springer International Publishing
Fig. 5.49 describes the ISR, DAC1RInterrupt, and the application program that uses this ISR.
Fig. 5.49 Interrupt Service Routine setup and DAC1 operation
Initially, the index, i, is set to zero while the DAC1 unit is initialized and enabled. Since only the right channel of DAC1 is used, the interrupt flag for this channel, IFS4bits.DAC1RIF, is first cleared, and then enabled by the statement, IEC4bits.DAC1RIE = 1. When the right channel data buffer, DAC1RDAT, becomes full of data the interrupt triggers, and IFS4bits.DAC1RIF = 1. The program subsequently clears the interrupt by IFS4bits.DAC1RIF = 0, and goes to the if (i == 0) statement to assign i = 1, and DAC1RDAT = 0xFFFF. When the DAC1RIF fires the second time, the program goes into the else-statement, and assigns i = 1, and DAC1RDAT = 0x1111 since the interrupt is still enabled. The ping-pong motion of the analog signal, corresponding to 0xFFFF and 0x1111 values, can be seen from the DAC1RP terminal (RB12 pin) on the oscilloscope.
Projects
1.
Write a program for the ADC unit in dspic33fj128mc802 such that an analog signal at AN0 is sampled continuously in auto sampling mode as shown in Program 5.2. First, apply a series of constant analog voltages at AN0 and check each 16-bit digital value generated by the ADC in the Watch window by inserting breakpoints in the program. Once this step is successfully accomplished, then apply an analog waveform, such as sinusoidal or a triangular signal, at AN0. Store the digital data in the data memory. Compare what is stored against the expected values.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Whiskies Galore by Ian Buxton(41524)
Introduction to Aircraft Design (Cambridge Aerospace Series) by John P. Fielding(32882)
Small Unmanned Fixed-wing Aircraft Design by Andrew J. Keane Andras Sobester James P. Scanlan & András Sóbester & James P. Scanlan(32569)
Aircraft Design of WWII: A Sketchbook by Lockheed Aircraft Corporation(32131)
Craft Beer for the Homebrewer by Michael Agnew(17927)
Turbulence by E. J. Noyes(7690)
The Complete Stick Figure Physics Tutorials by Allen Sarah(7135)
The Institute by Stephen King(6798)
Kaplan MCAT General Chemistry Review by Kaplan(6587)
The Thirst by Nesbo Jo(6432)
Bad Blood by John Carreyrou(6270)
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6219)
Learning SQL by Alan Beaulieu(6027)
Weapons of Math Destruction by Cathy O'Neil(5820)
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5641)
Permanent Record by Edward Snowden(5535)
Digital Minimalism by Cal Newport;(5384)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5181)
iGen by Jean M. Twenge(5151)
