Bit Bang Software Shift Registers – Apex Logic

ESP8266 development on OpenBSD with platformio

Hi,
I got platformio running on OpenBSD-current (it should work with older releases, too) and was able to compile a firmware for my ESP8266 NodeMCUv2. I haven't uploaded it to the board, yet, since it's still somewhere in the attic. Will test this soon and update this post. I guess it'll just work.

setup

You have to install the packages arduino-esp8266 and py3-pip:
# pkg_add arduino-esp8266 py3-pip 
And install platformio via pip:
# pip install platformio 

create project

The next steps were done as non-root user.
Now, create your project folder:
$ mkdir -p ~/code/myproject $ cd ~/code/myproject 
and initialize a platformio project:
$ pio init 
It should look something like this:
$ ls -la total 64 drwxr-xr-x 6 lotherk lotherk 512 Nov 1 09:02 . drwxr-xr-x 28 lotherk lotherk 1536 Nov 1 09:02 .. -rw-r--r-- 1 lotherk lotherk 5 Nov 1 09:02 .gitignore drwxr-xr-x 2 lotherk lotherk 512 Nov 1 09:02 include drwxr-xr-x 2 lotherk lotherk 512 Nov 1 09:02 lib -rw-r--r-- 1 lotherk lotherk 364 Nov 1 09:02 platformio.ini drwxr-xr-x 2 lotherk lotherk 512 Nov 1 09:02 src drwxr-xr-x 2 lotherk lotherk 512 Nov 1 09:02 test 
Now start writing code in src/main.cpp:
#include  #include  void setup() { } void loop() { } 
And edit platformio.ini:
[platformio] default_envs = nodemcuv2 [env:nodemcuv2] platform = espressif8266 framework = arduino board = nodemcuv2 
Please see the official Documention for which platform, framework or board you might need. Remember, this is all for esp8266 chips.

first build

It's now time for the first build, which will very likely fail:
$ pio run 
This will give you:
Processing nodemcuv2 (platform: espressif8266; framework: arduino; board: nodemcuv2) -------------------------------------------------------------------------------- Tool Manager: Installing toolchain-xtensa @ ~2.40802.191122 Error: Could not find the package with 'toolchain-xtensa @ ~2.40802.191122' requirements for your system 'openbsd_amd64' 
Researching this error led me to https://github.com/trombik/platformio-freebsd-toolchain-xtensa/. What @trombik did was creating a fake platformio package with symlinks to the right files on the system. In his case it was FreeBSD but I tried it anyway. It mostly worked out of the box, I just had to symlink the xtensa-lx106-elf-* binaries from /uslocal/bin into the package. I created my own fake package for OpenBSD at https://github.com/lotherk/platformio-openbsd-toolchain-xtensa.
Clone the repository and place it to ~/.platformio/packages/toolchain-xtensa. It is important to name the folder toolchain-xtensa! Ensure that xtensa is installed, but it should come with the arduino-esp8266 package:
$ pkg_info |grep xtensa xtensa-lx106-elf-binutils-2.32 binutils for xtensa-lx106-elf cross-development xtensa-lx106-elf-gcc-5.2.0 gcc for xtensa-lx106-elf cross-development xtensa-lx106-elf-newlib-2.1.0p0 newlib for xtensa-lx106-elf cross-development 
Now change to the directory and run init.sh, which will create all the symlinks you need.
$ cd ~/.platformio/packages/toolchain-xtensa/ $ ./init.sh 
Back to our project and re-run pio:
$ cd ~/code/myproject $ pio run 
This time it does a lot more, but now fails complaining it can't find tools-esptool:
Processing nodemcuv2 (platform: espressif8266; framework: arduino; board: nodemcuv2) ----------------------------------------------------------------------------------- Tool Manager: Installing framework-arduinoespressif8266 @ ~3.20704.0 Tool Manager: Warning! More than one package has been found by framework-arduinoespressif8266 @ ~3.20704.0 requirements: - platformio/framework-arduinoespressif8266 @ 3.20704.0 - jason2866/framework-arduinoespressif8266 @ 2.7.4.1 - tasmota/framework-arduinoespressif8266 @ 2.7.4.3 Tool Manager: Please specify detailed REQUIREMENTS using package owner and version (showed above) to avoid name conflicts Unpacking [####################################] 100% Tool Manager: framework-arduinoespressif8266 @ 3.20704.0 has been installed! Tool Manager: Installing tool-esptool @ <2 Tool Manager: Warning! More than one package has been found by tool-esptool @ <2 requirements: - platformio/tool-esptool @ 1.413.0 - volcas/tool-esptool @ 1.413.1 Tool Manager: Please specify detailed REQUIREMENTS using package owner and version (showed above) to avoid name conflicts Error: Could not find the package with 'tool-esptool @ <2' requirements for your system 'openbsd_amd64' 
Fortunately this is as easy as fixing toolchain-xtensa. I've created a fake package for esptool aswell. esptool must be installed, tho. Which it already should be because of the arduino-esp8266 package. Clone https://github.com/lotherk/platformio-openbsd-tool-esptool to ~/.platformio/packages/tool-esptool (naming is important...) and run init.sh as you've done with the toolchain-xtensa package.
Rerun pio and it should compile now:
$ cd ~/code/myproject $ pio run Processing nodemcuv2 (platform: espressif8266; framework: arduino; board: nodemcuv2) -------------------------------------------------------------------------------- Verbose mode can be enabled via `-v, --verbose` option CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html PLATFORM: Espressif 8266 (2.6.2) > NodeMCU 1.0 (ESP-12E Module) HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash PACKAGES: - framework-arduinoespressif8266 3.20704.0 (2.7.4) - tool-esptool 0.1.0 - tool-esptoolpy 1.20800.0 (2.8.0) - toolchain-xtensa 2.40802.191122 (4.8.2) LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf LDF Modes: Finder ~ chain, Compatibility ~ soft Found 29 compatible libraries Scanning dependencies... Dependency Graph |--  1.0 Building in release mode Compiling .pio/build/nodemcuv2/src/main.cpp.o Generating LD script .pio/build/nodemcuv2/ld/local.eagle.app.v6.common.ld Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/BearSSLHelpers.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/CertStoreBearSSL.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFi.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiAP.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiGratuitous.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiMulti.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiSTA.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/ESP8266WiFiScan.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiClient.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiServer.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o Compiling .pio/build/nodemcuv2/lib74a/ESP8266WiFi/WiFiUdp.cpp.o Archiving .pio/build/nodemcuv2/libFrameworkArduinoVariant.a Indexing .pio/build/nodemcuv2/libFrameworkArduinoVariant.a Compiling .pio/build/nodemcuv2/FrameworkArduino/Crypto.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Esp-frag.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Esp-version.cpp.o Archiving .pio/build/nodemcuv2/lib74a/libESP8266WiFi.a Indexing .pio/build/nodemcuv2/lib74a/libESP8266WiFi.a Compiling .pio/build/nodemcuv2/FrameworkArduino/Esp.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/FS.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/FSnoop.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/FunctionalInterrupt.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/HardwareSerial.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/IPAddress.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/MD5Builder.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Print.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Schedule.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/StackThunk.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Stream.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/StreamString.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Tone.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/TypeConversion.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/Updater.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/WMath.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/WString.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/abi.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/base64.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/cbuf.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/cont.S.o Compiling .pio/build/nodemcuv2/FrameworkArduino/cont_util.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_app_entry_noextra4k.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_eboot_command.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_features.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_flash_quirks.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_flash_utils.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_i2s.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_main.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_noniso.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_phy.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_postmortem.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_si2c.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_sigma_delta.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_spi_utils.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_timer.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_waveform.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_wiring.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_wiring_analog.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_wiring_digital.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_wiring_pulse.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_wiring_pwm.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/core_esp8266_wiring_shift.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/crc32.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/debug.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/flash_hal.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/gdb_hooks.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/heap.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/libb64/cdecode.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/libb64/cencode.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/libc_replacements.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/sntp-lwip2.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/spiffs/spiffs_cache.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/spiffs/spiffs_check.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/spiffs/spiffs_gc.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/spiffs/spiffs_hydrogen.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/spiffs/spiffs_nucleus.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/spiffs_api.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/sqrt32.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/time.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/uart.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/umm_malloc/umm_info.c.o Compiling .pio/build/nodemcuv2/FrameworkArduino/umm_malloc/umm_integrity.c.o Compiling .pio/build/nodemcuv2/FrameworkArduino/umm_malloc/umm_local.c.o Compiling .pio/build/nodemcuv2/FrameworkArduino/umm_malloc/umm_malloc.cpp.o Compiling .pio/build/nodemcuv2/FrameworkArduino/umm_malloc/umm_poison.c.o Archiving .pio/build/nodemcuv2/libFrameworkArduino.a Indexing .pio/build/nodemcuv2/libFrameworkArduino.a Linking .pio/build/nodemcuv2/firmware.elf Retrieving maximum program size .pio/build/nodemcuv2/firmware.elf Checking size .pio/build/nodemcuv2/firmware.elf Building .pio/build/nodemcuv2/firmware.bin Advanced Memory Usage is available via "PlatformIO Home > Project Inspect" RAM: [=== ] 32.7% (used 26776 bytes from 81920 bytes) Flash: [== ] 24.6% (used 256780 bytes from 1044464 bytes) Creating BIN file ".pio/build/nodemcuv2/firmware.bin" using "/home/lotherk/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and ========================= [SUCCESS] Took 70.35 seconds ========================= 
Et voila, you've compiled a firmware for your esp8266 chip on OpenBSD.
Uploading the firmware should only be a matter of configuring the right serial port in platformio.ini. As soon as I get mine from the attic, I will try it and update this post.

Edit: spelling
submitted by lotherk to openbsd [link] [comments]

Making a super low cost trainer/dev kit. What do you wish you had in the kits/trainers you used to learn electronics?

Useless Backstory:
My original plan was to design a digital logic trainer for my students that could be submerged in alcohol without damage, to sanitize between classes. I did that and the prototypes work great (Other components for scale)
It's fair to assume the campus will close pretty quickly after the first spikes in covid cases. This means the original design won't be useful, students won't be in to share the equipment. Many departments plan to just gut their lab courses while some plan to throw huge tool/equipment costs at their students for at-home labs. I don't consider removing hands-on work a viable option, and equipment would cost a ton because the school store is terrible as far as where they can get products from, plus it takes its own cut of ~20%. The school store is the only way to pay for things with financial aid, so I have to go through them.
I priced everything out for my original design and discovered the board is so unbelievably cheap ($22 vs the $350 we pay for just ONE of the trainers the students use) that I plan to just make a new version that also includes all the features from the analog, processor, and plc trainers. Should cover everything from learning ohm's law to designing and testing amplifiers, from digital logic through assembly language up to C++/Python, from relay/ladder logic to PLC programming.
To the point:
For reference, here's a google image search of what I am designing a replacement for. Click on some at random and check the prices and specs. There's no reason they should cost hundreds. The ones that don't cost a ton are just switches and buttons and leds wired to headers - something anyone here can do for $10.
My goal is to add all the features from every single trainer I've seen/used but keep below 10% of the price of what is currently available. Each unit of equipment my students use (scopes, generators, supplies, digital/analog trainers, processor boards, plcs, etc) cost the department $5k+, and that's even after I got them to approve sparkfun as a vendor to save money. Assuming the students pick up shitty, low spec versions of everything for doing their labs at home, we're still looking at $1k. I like <$100 better, and would like the students to have something they can continue using to learn/develop electronics even after graduation.
So far I'm at $48 per trainer, completely assembled and in a case and I'm just about ready to make the next batch of prototypes but want to know what additional features I should cram into it.
What should I add that isn't listed below?
Supplies:
(1)+/- 19V 3A isolated supply
(2)+/- 5V 1.5A supplies
(1) 19V variable supply
(1) Constant-current linear regulated supply
(2) CV/CC switchmode supplies (fairly well filtered)
Power input is by default USB-C 20V/100W but I got impatient waiting on the USB-C sockets to come in the mail and rigged one up with a laptop DC jack (19.5V) for testing. I liked it. Most people have a box of old adapters in their house so I might just throw empty spots all around the back edge with the traces and pads for 10 different types of sockets so that anyone can use any supply they have lying around within the 18-34v 3A+ range. It already has overvoltage/undervoltage/overcurrent protection, adding a receiver for laptop signal pins that tell the system what the power brick is rated for would be easy.
There's also a USB micro-b port that can power everything but the analog supplies. It is also used for reprogramming firmware in the event of serious corruption, but updates and changes by default occur over wifi.
Outputs:
(1) 500mA Isolated Function Generator (12.5Mhz)
(1) function generator that acts as a 16.5V 1A CT transformer output (max 1mhz)
(2) digital clocks (1hz - 40khz)
(1) digital clock (1khz to 200mhz)
(24) 50mA 3-state digital outputs, protected from short circuits to any other line on the board, including the analog voltages. Each is configurable to a switch, button, low frequency clock, or tied to the PLC emulator or processor used for teaching programming.
Communication:
Wifi/Bluetooth, USB client and host, Modbus TCP/IP, Modbus RTU, CAN bus, i2c, i2s, spi, plus anything slow enough to be bitbanged will also be available as a feature through the UI, but not have a dedicated port. For example, you can load a 1-24 bit binary string in through the switches and shift it into 74000 series shift registers.
Inputs:
(4) Multimeters with 10mV precision, two of which are differential and isolated.
(24) 3-state digital inputs (+/- 20V capable, configurable logic levels)
(2) analog inputs (1Msps) - I hesitate to call it an oscilloscope because the next revision will include an FPGA that can actually handle huge amounts of data at high frequency. For now it dumps the data to a RAM IC and the main processor grabs a selection of addresses and renders a graph on the screen. There's no interrupts or anything that could get sub-clockcycle measurements on transitions directly from that data.
(2) 100mhz counters with automatic or adjustable trigger.
User Interface:
3.5" color touch screen - while every feature can be accessed from the touch screen, it's mostly for configuring things. I've made sure to put all features as physical buttons, switches, and knobs.
Wifi AP with captive portal - same access as the touch screen, but also used for uploading code to the processors (ASM ide and arduino ide) or PLC emulator (openplc). Working with a friend to help ensure mobile/tablet compatibility.
Bluetooth - available but not currently used.
Features:
IC testing with learning function - throw any common DIP chip into a socket and it will test whether it's fried. The UI also allows you to add in new chips, where you define which pins are inputs, outputs, power, ground, oscillator, analog, etc and whether you want it to automatically learn from every possible input configuration or a set sequence of commands. This includes i2c/spi chips.
Programming microcontrollers - throw a dip uC into the same socket as the ic tester and it'll configure itself to whatever pinout you define or select from a list. Already have a USB ISP for AVR but will add loads of ports matching the most popular in-system-programmers.
Matrix I/O sniffing - plug any matrix keypad or matrix led display into the I/O lines and it will automatically map them for you.
Communications sniffing - find IR remote codes, i2c addresses, RF codes, etc without external circuitry.
Compatibility with the Analog Discovery 2, Atmel ICE, LabView/Multisim, and I'm tinkering with SCPI to connect to bench equipment.
PLC Programming through OpenPLC.
Full diagnostic utility with schematic and fault indication through the UI. It will literally tell you what is wrong within a 1 centimetre radius on the board, show you the PCB/silkscreen of the area and optionally the schematic, and tell you what to replace to fix it. I added fault detection with port expanders, analog multiplexers, and dummy loads to help me test my original prototypes. It was supposed to be temporary but the work is already done and only added $5 to the total cost so now it's going to be in every future revision. Not a big jump to add pictures of every subcircuit PCB traces/silkscreen.
As an added note, when I'm done with each set of prototypes I plan to give them away on this subreddit for free, but I want to be sure there's no liability on my part. I'm concerned because all but the last version won't have UL/FCC/CE compliance. If anyone could direct me to information on this sort of thing, I'd really appreciate it. I'm thinking maybe I just directly call them "as-is" or defective or scrap?
submitted by -Mikee to arduino [link] [comments]

ESP32 Level Shifting Hack/Theory (ADC/DAC)

Test this with your ESP32 at your own risk, for it is definitely not an intended use.
Using a fast (built-in) ADC and DAC in combination, I suppose that a microcontroller could theoretically communicate with a lower-voltage device directly, without any extra level shifting components. (If it's not already built-in, then it's not cheaper than just getting a Chinese level-shifter board.) This will not work with an external device that expects a voltage HIGHER than your own, so only 5V 3.3V or 3.3V 1.8V, etc.
This (untested theory) works using the DAC (with strict discipline to avoid magic smoke) to generate the lower voltage for TX, and the ADC for analog reading a lower-than-our-own logic level on RX.
You may need to poke around in your microcontroller's registers to change the ADC to prefer read speeds over resolution. You also (depending on current consumption) might be able to power the external device with another DAC pin, as long as it doesn't sink too much current from the poor pin. If it's logic level 1.8V, there's a good chance it also wants 1.8V on its VCC line. That's hacky AF, but keeps to the "no extra components" theme. Although, it's easier just to create a voltage divider from your own board's VCC if current is low enough for the resistors used. Or you could be extra boring and use a proper voltage regulator like you truly should. But that's no fun.
Please note: unless your microcontroller has a pin which can be switched to either a DAC output or an ADC input on the fly (and do this fast as hell) this does not easily allow for bidirectional communications such as I2C, SPI or PJON (shared data line) - only single-directional protocols like UART or whatever you want to send/receive with something like ASK/OOK. Or it can be used with simple binary states, like how a PIR motion detector will just output HIGH for a while when triggered.
For something like SPI or PJON, it could be possible to connect both the DAC and ADC pins to the bidirectional data line, and leave the DAC as a floating INPUT when you need to read the ADC when data is expected to return. However, make sure your code COMPLETELY ignores the DAC pin during this time, as it's digitalRead() status of HIGH or LOW will be unpredictable during the time while it is floating, that means no pin change interrupts allowed on the DAC pin until the data read is over. (You likely won't have a pin change interrupt option on a pin configured as a DAC anyways.)
DISCLAIMER: I have currently only tested this method in an RX fashion, to allow a 5V Arduino UNO to read 1.5V binary output from my digital calipers, using two ADC pins to read clock and data, and having them keep track of the highest voltage they've seen in the last while, divided by two, to get a threshold for converting the raw analog readings to HIGH and LOW states. I have not yet tested the DAC side of this theory at all, for now I'm just sharing the idea for you guys if you want to try it.
I've posted this in ESP32 as it is the only microcontroller I own with both an ADC and DAC, and has a fast enough processor to possibly facilitate controlling both at decent UART speeds. If anyone wants to try this and report back with results, or has an oscilloscope to point out potential DAC voltage dangers that may occur on the ESP32's boot-up with this setup, I'd love to hear your feedback!
submitted by connornishijima to esp32 [link] [comments]

Arduino Tutorial 42: Understanding How to Use a Serial to ... Binary Counter with Arduino TI SN74HC595 Shift Register How to use 74HC165 Shift Register with Arduino - YouTube Arduino Tutorial #3 - Shift Registers (74HC595) - YouTube Arduino Tutorial with code: Adding more digital outs with the 74HC595 Shift register Bit Shifting - Teaching Arduino to Copy Morse Code Use Shift Registers to create more Inputs on Arduino ...

Monday, October 17, 2016. Arduino Shift Out Binary Options Este proyecto implica descodificar varias entradas (en este caso 7) para mostrarlas como valores numéricos en una pantalla de siete segment... For example, if the input number is 11010, the shift width is 2, and cut length k is 4, then the output is 0011 in logical shift and 1111 in arithmetic shift. You can also extend the length of output binary numbers by using signed and unsigned padding. The signed padding will use 1-bits and the unsigned padding will use 0-bits. Additionally, you can decorate the shifted bytes with the binary ... This is almost identical to the Arduino Shift-Out function. This function can only do what its name implys though, shifting out. For other modules such as the RF12 wireless module the SPI data bus requires you to send and receive a bit in the same clock cycle. For this we will need to used the Hardware SPI which I will discuss in the next tutorial. For now the shift out function is simple and ... Open-source electronic prototyping platform enabling users to create interactive electronic objects. Arduino shiftout lsbfirst. Leaders. Policy & Regulation. Community Banking. Search Query Submit Search. Log In. Subscribe. Arduino shiftout lsbfirst ... we do the shift of data using the shift out command . and we set the latch pin back to high to signal the chip we are done and to output it on the Q0->Q7. The value that is passed, will be represented in binary on the LED. If you never done any binary math before, I got a video on this as well Im trying to figure out how to send and receive binary data using arduino to send the data and python to receive it I am able to run my program right now using Serial.print() and Serial.println() just fine. Except I need to give it a performance boost. I am sending over data like so: Serial.write(pot0holder); Serial.write("."); The Arduino Reference text is licensed under a Creative ... permitted values are BIN(binary, or base 2), OCT(octal, or base 8), DEC(decimal, or base 10), HEX(hexadecimal, or base 16). For floating point numbers, this parameter specifies the number of decimal places to use. For example- Serial.print(78, BIN) gives "1001110" Serial.print(78, OCT) gives "116" Serial.print(78, DEC) gives "78 ... Arduino Powered 7 Seg LED Display Using Shift Registers - I Made It at TechShop: Seven segmented displays are great. They are pretty simple, don't take much power, and have a lot of flexibility when it comes to displaying numbers. But setting aside 14 pins just to run it is such a pain. If only there was a way to use them withou…

[index] [7141] [16301] [15681] [14552] [6716] [8992] [6634] [13865] [10709] [16049]

Arduino Tutorial 42: Understanding How to Use a Serial to ...

Find out why Close. Binary Counter with Arduino TI SN74HC595 Shift Register Paul Marriott. Loading... Unsubscribe from Paul Marriott? Cancel Unsubscribe. Working... Subscribe Subscribed ... // 74HC595 74HC165 // Pin 1 - LED 1 Pin 1 - Load // Pin 2 - LED 2 ... To do that we will need to turn the dits and dahs in to a bit stream, shifting along as we go. This short video demonstates how bit shifting works. This short video demonstates how bit shifting works. You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming: https://www.patreon.com/P... Running out of Inputs on your Arduino Project? Here's an easy way to add 8 digital inputs, using the CD4021 shift register! Stay tuned for follow up tutorial... Showing the simple operation of the 74HC595 8 bit shift register. Including expanding the number of digital out pins on your arduino. Including expanding the number of digital out pins on your ... Contribute: Patreon: https://www.patreon.com/EE_Enthusiast Arduino Code: http://staticjolt.com/shift-registers-arduino-tutorial/ 74HC595 Datasheet: http://ww...

http://binary-optiontrade.thefttiterca.tk