5 ms·
Fun stuff. You kids don't know how lucky you are to have really capable MCU's for just a few bucks. :-) It is kind of the ultimate "not a TOE[1]" example yet.
by ChuckMcM 1y ago
Fun stuff. You kids don't know how lucky you are to have really capable MCU's for just a few bucks. :-)
It is kind of the ultimate "not a TOE[1]" example yet.
[1] TOE or TCP Offload Engine was a dedicated peripheral card that implements both the layer 1 (MAC), layer 2 (Ethernet), and layer 3 (IP) functions as a co-processing element to relieve the 'main' CPU the burden of doing all that.
- nine_k 1y agoDon't modern NICs do a lot of the same, too?
- tyingq 1y agoSometimes it goes the other direction. PCI SSL accelerator cards were a thing for a long time before CPUs got faster, got various crypto acceleration opcodes, web servers rewrote SSL logic in ASM, etc.
- lillecarl 1y agoThe fancy Mellanox NVIDIA Connect-X cards have kTLS support which offloads encryption to the NIC, Netflix has blogged about how they use it to send 100 Gbps encrypted traffic of a single box (Their OpenConnect infrastructure is really cool). Old is new again :)
- kragen 1y agoOr just a few cents! Possibly that will only last until war in Taiwan, though, or until it becomes impossible to find anything but counterfeits.
- 4gotunameagain 1y agoUncertain. The cheap, mass produced commodity ICs are built with "ancient" nodes with high yields.
- kragen 1y agoI think that's probably true for Padauk's PFS150 and similar, but I think the 14¢ https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_WCH-Jiangsu-Qin-Heng-CH32V003A4M6_C5346357.html https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU... and the 9¢ https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_PUYA-PY32F002BD15S6TU_C7469097.html https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU... are probably fabbed in more recent nodes. And of course the counterfeit problem has very little to do with what node is used to produce the chips; it's a question of how effective your society's institutions are at keeping fraud under control.
- Dylan16807 1y agohttps://zeptobars.com/en/read/wch-ch32v003-risc-v-riscv-microcontroller-10-cent https://zeptobars.com/en/read/wch-ch32v003-risc-v-riscv-micr... This page estimates 90nm for the CH32V003, and I found another post very roughly estimating 130nm. And a pi pico isn't all that fancy either at 40nm. And should I be very worried about counterfeit microcontrollers? It seems like a lot of effort, and like it would probably still work.
- kragen 1y agoThere are different levels of "counterfeit". There's the clearly labeled and advertised GD32F103 style clone which is pin-compatible, supports higher clock speeds than the original STM32F103, but takes much longer to power on and has different analog characteristics, maybe some worse; not a problem. There's the potential case where somebody sells you a GD32 telling you it's an STM32, either with the proper markings, with the markings sanded off, or with actually fake markings. This still might cause no problems, or might result in a problem that takes you a long time to track down. (Maybe you're unknowingly relying on, say, the hypothetical lower power consumption of a clone, so when you fab a batch with real STM32s, the product's battery life goes to shit.) You can detect this in firmware and may be able to come up with workarounds. Or, if your vendor is FTDI, they may sneak malware into their Microsoft Windows driver and brick your products months or years after you've sold them. They've done it twice. There's the case where the clone is designed to act as much like the original as possible, so maybe you can't detect the substitution in firmware and can't work around whatever problems the counterfeit is causing. Then there's the case where you ordered 10,000 STM32s in a QFN-32 and got 10,000 QFN-32s that say "STM32" on them but are actually PICs with a totally different pinout, or SRAM, or something else. These will not probably still work.
- ryao 1y agoThis depends on the PIO in the RP2040/RP2350. As far as I know, that is an innovation exclusive to the Raspberry Pi company, so it would not be possible to do this on another microcontroller: https://magazine.raspberrypi.com/articles/what-is-programmable-i-o-on-raspberry-pi-pico https://magazine.raspberrypi.com/articles/what-is-programmab... The microcontroller has additional cores called state machines in the PIOs that are specifically designed for bit banging and have their own custom ISA that reportedly only has 9 instructions.
- kragen 1y agoYes, it does, although it's almost like horizontal microcode; it can do several things in a clock cycle other than the instruction itself. I didn't mean to imply that you could bitbang 100BaseT with a Padauk PFS150 or a PY32. The Padauk FPPA chips are probably a bit better at bitbanging strange protocols than any ARM, but not in the same class as the Pi's PIO.
- kragen 1y agoAfter consulting the datasheet, I think the most things you can do in a single pioasm instruction would be a conditional decrementing JMP with side-set, wrap, and delay: • decrement the X or Y register; • conditionally jump to a specified target address if it was nonzero; • otherwise, jump (by "wrapping") to some other specified target address, usually an outer infinite loop; • change the state of four or less GPIO pins to immediate constants; • delay 1–15 clock cycles. Arguably IN can compete here, replacing the first two items with: • set one or more GPIO pins from bits shifted out of a shift register; • conditionally "autopull" a 32-bit word from an input FIFO if the shift register is empty; • conditionally stall the pioasm program if the FIFO is empty; • conditionally initiate a DMA request to refill the FIFO if it's not full. The OUT instruction has similar "autopush" capabilities. Most of these are somewhat independent choices, but if you don't pull from the FIFO you won't have the other effects, and several of the options are state-machine-wide.
- hunta2097 1y agoI can't get my head around it sometimes. I know most end up doing duties that a PIC-chip could do but the fact you can get a WiFi enabled microcontroller few a few bucks blows my mind. The IO co-processing on the Pico is so powerful, I hope they expand on this.
- nerdsniper 1y agoIt's also not really clear that using some of the more powerful chips for simple things is really a "waste" in any reasonable sense of the word. The packaging of a PIC/CH32 is probably the majority of its cost and environmental "footprint". An RP2040 is not much more physical material. An ESP8266/ESP32 is rather bit more material, but still not egregious.
- projektfu 1y agoThe big waste is battery power, which for many hobby things is not that important. For comparison, RP2040 quiescent current is like 400μA, FRAM MSP430 is approximately 0.1μA in interruptible sleep.
- HeyLaughingBoy 1y agoRight? Especially when I remember paying $20 each for an 8-bit microcontroller with less than 1k EPROM.
- torben-friis 1y ago>Fun stuff. You kids don't know how lucky you are to have really capable MCU's for just a few bucks. :-) Any suggestions for people not used to tinkering with hardware? I would like to play I think, but I have a lack of imagination regarding potential projects/goals.
- bux93 1y agoI have plenty of ideas, I'm just super lazy! I'd like to hook up a rain sensor to a skylight to close it when it rains (needs a little motor, too), and then also hook it up to weather forecasts. I currently have to switch on my TV, surround set and a laptop, and then push multiple buttons to switch to/from a firestick. I'd like to automate that, so I can just switch it on/off and switch the source easily. Also if the system is in an unknown state (tv on, but using the incorrect HDMI input and the surround set if switched off, etc.), which is what the naive solution using a "fingerbot" and a IR blaster hooked up to godawful tuya stuff doesn't do. Build a GPS-synchronized flip clock. Add remote control door opening without destroying my flat's intercom system. Mostly kinda boring home automation stuff, but would be worth it for tinkering.
- ficklepickle 1y ago> Add remote control door opening without destroying my flat's intercom system. Oh hey, I made that[0] at a previous apartment! It sat on my LAN and I'd VPN in if I was out of wifi range. I struggle to find time/motivation for stuff like that these days. I was contracting back then and had downtime between jobs. [0] https://github.com/jeremy21212121/doorman-building-arduino https://github.com/jeremy21212121/doorman-building-arduino
- samarthr1 1y agoAs someone who is only mildly bullish about AI, my hope is that such ultra custom HA will be more common, and no longer limited fo the 0.1% and software engineers.
- ChuckMcM 1y agoI can recommend a 'Hacker Boxes'[1] subscription. It's $44/month currently, every month you'll get all the parts to build some gizmo or project and a full list of instructions. The prerequisites are that you know how to solder and have a soldering iron, and have a computer you can run the Arduino IDE on (even a Raspberry Pi can do that these days). If you don't know how to solder the Hacker Boxes folks have a soldering workshop kit that includes an iron[2], but many maker spaces will do soldering clinics. Soldering irons are available as cheap[3] and more expensive[4] (and ludicrous[5]). The Arduino IDE runs on pretty much anything (Linux, MacOS, Windows). [1] https://hackerboxes.com/ https://hackerboxes.com/ [2] Soldering Workshop --- https://hackerboxes.com/collections/subscriptions/products/soldering-workshop https://hackerboxes.com/collections/subscriptions/products/s... [3] $13 iron from Amazon --- https://www.amazon.com/dp/B09DY7CCW5 https://www.amazon.com/dp/B09DY7CCW5 [4] ~$150 soldering station --- https://www.amazon.com/dp/B077JDGY1J?th=1 https://www.amazon.com/dp/B077JDGY1J?th=1 [5] $1000+ Metcal station --- https://www.qsource.com/itemdetail/?itemCode=MX-5210-M020 https://www.qsource.com/itemdetail/?itemCode=MX-5210-M020