Waveform and Signal Generator - DDS & DAC - RPN Expressions Calculator
by kalfakisd in Circuits > Arduino
23 Views, 0 Favorites, 0 Comments
Waveform and Signal Generator - DDS & DAC - RPN Expressions Calculator
A Direct Digital Synthesis Machine
and RPN Calculator
Visit my site for updated files: https://sites.google.com/site/demeterart/home?pli=1
FEATURES
The types of waveform are : SINE, SQUARE, TRIANGLE, SINC, MUSIC-multitone, USER DEFINED with RPN expressions. There is also ability for frequency sweep in linear or log mode. Variable buffer size from 4 to 4096 bytes, correction factor for different CPU clocks, duty cycle specification for square and triangular waves, frequencies in excess of 100KHz with S/N for low frequencies sinewaves 45dBV; also:
- Based on raspberry pi pico, a text LCD 2x16 display, a 4x4 keypad and an optional MCP6002 op-amp. Programming with complex numbers and calculator mode with BigNumbers; press double dots (..) to toggle between them. A total of 8 calculator key maps including letters A...Z and symbols. RPN functionality with variable stack depth and number of tokens. Nested expressions to memory limit. User defined variables, arrays, strings and functions. Transfer Function computation in s/z domains, DFT and convolution. Solve linear systems and nonlinear equations. LittleFS (flash) as well as EEPROM functionality for storing / recalling programs and data. Standard and scientific notation. User defined system settings.
- This version does not support SD and audio playback.
Supplies
Summary
This work is based on the port of rp2040 to the arduino environment by Earle Philhower. Go to https://github.com/earlephilhower/arduino-pico and follow the instructions to download the respective tool-chain and libraries to your arduino IDE which must be 1.18 or later for proper driver support. You only need to hold the BOOTSEL button the first time while you insert the USB cable. The driver will load automatically in the future. After programming you may need to hold the ESC key while pressing reset to connect to the PC if the configuration speed is lower than 50MHz..
The firmware is based on PICOLCDv1.23d and enters DDS mode after start-up.
The machine is typically compiled for a clock speed of 133MHz. You must also enable optimization option -O3, with the option of some flash file-system (I use 2MB-128KB) for a LittleFS partition. The clock speed can also be set during run time either by the EEPROM configuration settings or command e5 but the DDS functionality is calibrated for a 133MHz CPU and optimization -O3. The firmware supports a 4K EEPROM emulation using the internal flash. The keypad uses 8 digital I/O lines via polling.
When used for the first time, the EEPROM values for the configuration of the machine must be ignored until manually set by the user. Usually, this is not necessary as the EEPROM location at 4095 must also be set to 1 for EEPROM settings to override RAM settings. However, to illustrate the method, when resetting the calculator keep pressed the ESC key during power-up in order to load the default RAMvalues. See the EEPROM CONTENTS section below.
Themathsoftware uses complex numbers of double precision. There is also limited support forBigNumbers(NickGammon); toggle between the two modes by pressing two consecutive dots (..) or set the respective variable bb (big) to 0/1 respectively.
The machine supports calculator and programming modes. Use two successive dots .. (* key) to toggle between programming (COMPLEX) and calculator (BIG) modes; BIG mode handles only real numbers (BigNumbers).
In programming mode there are 2 general internal functions that compute any result:
- commands with optional parameters – internally execute(). These use the notation ‘eX’ where X is an integer and return any relevant result to global variable %d.
- RPN expressions calculated by internal expression(). Expressions are built by a combination of single-key operators with visual mnemonics (those found on the various key maps) and verbose statements/commands.