- #Mplab xc8 migration issues and limitations generator#
- #Mplab xc8 migration issues and limitations code#
However, the ADCC does not have the ability to left-shift results, only right-shift. Doubling the Frequencyĭoubling the frequency is equivalent to left-shifting the result by 1 bit. To get a 50% duty cycle, then the NCO output frequency must be doubled. One problem that arises from the frequency output is the duty cycle. The smaller the word is, the lower the jitter for non-integer frequencies of the NCO. The NCOs use a 20-bit word for incrementing the frequency. NCO1 acts as the frequency synthesizer in this example. Theory of Operation Voltage-to-Frequency (V/F)īlock Diagram of the V/F Converter (for reference)
(This example uses the plugin version for MPLAB X IDE). Note: If MPLAB Data Visualizer isn't installed, no icon will appear in the toolbar. At this point, the equivalent impedance (of the circuit) is 50% of the potentiometer value. Important! The acquisition time of the ADCC has to be adjusted depending on the impedance of the potentiometer! The worst-case equivalent impedance for the potentiometer is at the 50% position. To use a potentiometer as the voltage source, you will have to build the following circuit:Įxample Setup.
#Mplab xc8 migration issues and limitations code#
The following table summarizes the pin assignments in this code example: Pin If the combined example is run, only 1 of these is required, as the output can be looped back into the other.įor evaluating the performance independently of the microcontroller ( optional), you will also need:
#Mplab xc8 migration issues and limitations generator#
Function Generator (for using the F/V to generate the analog output).Power Supply or Potentiometer (for using the V/F to generate the waveform).PIC18F57Q43 Curiosity Nano (P/N: DM164150)ĭepending on the example, you will either need:.This code example uses the Numerically Controlled Oscillator (NCO), the Signal Measurement Timer (SMT), UART, Direct Memory Access (DMA), Digital-to-Analog Converter (DAC), Analog-to-Digital Converter with Computation (ADCC), TMR0, TMR2/TMR4/TMR6 and Configurable Logic Cell (CLC) peripherals. Both examples operate core independently on the same microcontroller. Using the peripherals in the PIC18F57Q43 microcontroller, a voltage-to-frequency (V/F) and frequency-to-voltage (F/V) converter can be created using no external components. Voltage-to-Frequency and Frequency-to-Voltage Converter with PIC18F57Q43