Use for a (very) cheap or low spec microcontroller - Page 1
Forum section: electronics / projects

author: romhunter
author_rank: Regular Contributor
timestamp: March 12, 2019, 09:13:42 pm
content: I'm just asking if anyone know anything to do with those (very) cheap micro that got absolutely next to no peripheral? I'm just looking for idea, since I'm so bored working on the large 64 pins ones (heck, I don't even use past 10 or 20 pins of those).I mean the barebone one, like PIC10F200? ATTiny4? Padauk (god, OTP with strange C)? 89S52? What are they good for?Any suggestion is welcome!

author: JPortici
author_rank: Super Contributor
timestamp: March 12, 2019, 09:45:10 pm
content: reprogrammable glue logic, "intelligent" ADC, UART multiplexer are three things i've used super simple MCUs forreprogrammable glue logic:-customer has lots of black boxes that do something-customer wants the output to behave differently (inver in certain conditions)-could be done with a couple of gates max, but i know that the customer will have different requirements on the next order and even different on the following oneSo one modification, change the firmware accordinglyIntelligent ADC:channel scan, filtering, SMB, internal diagnostic or things like thatUART multiplexer:one full duplex stream (remote) that goes to different units. remote send a special command to change the mux selection

author: mariush
author_rank: Super Contributor
timestamp: March 12, 2019, 09:58:09 pm
content: noise generators,motion sensors (for example detect if door opens by contacts being separated or infrared beam being broken) ,on/off/wakeup controllers (hold button x seconds to turn on or off main device or a relay),switch between battery and dc input, enable charging of battery when dc input plugged inif it has adc with internal reference, maybe battery monitor ex chip reads battery voltage and lights up 1 to 4 leds, or blinks color of a led (red. yellow, green) or beeps every n minutes if battery goes below some threshold.replacement for old chips that are no longer made (like let's say 4 bit or 8 bit input to 7 segment hex digit),conversion between interfaces for example convert some proprietary display stuff to 4bit/8 bit lcd display (2x16 / 4x20)

author: DaJMasta
author_rank: Super Contributor
timestamp: March 12, 2019, 09:58:54 pm
content: Basic programmable timer circuits and things too - stuff you could do with analog, but you save on some passives (more like saving on production time) and can reconfigure in software as needed. A lot of small electronic toys have a micro in them for blinking lights, making a sound, running a motor for 10s, etc. because it's actually cheaper to do and easier to reconfigure than making equivalent basic analog circuits.

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: March 13, 2019, 01:31:37 am
content: Quote from: DaJMasta on March 12, 2019, 09:58:54 pm^ ThisJportici gives many good ideas, but the one area where a single chip micro realty improves on the "old ways" is for those applications which used to be implemented with a 555 timer + some logic. Back in the 1970's micro's were too expensive and new, so glitchy 555 timer circuits abounded. I hate these with a passion! With even the simplest micro you can code rather comprehensive state machines that take into account the variability in the analog world. Tempco's, key debouncing, elimination of trimpots and manual calibration, ect. can be done in software. And accomplished at automated test time in production, rather than require manual setting.It helps of course if the micro has PWM and an ADC, and possibly some comparator pins - not a stretch as these features are now basic on some of the simplest micros

author: Nitrousoxide
author_rank: Regular Contributor
timestamp: March 13, 2019, 06:41:21 am
content: Long/short button press detector.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 13, 2019, 09:26:13 pm
content: A LED night light brightness controller using a tiny MCU and anAL8805. On/off and brightness control via a rotary encoder.Almost all adjustable LED current supplies seem to have a very annoying hum/whine (from mains if triac based, or from PWM). Horrible for a bed reading light. A 12V 0.5A wall wart is silent, and the AL8805 can adjust the current with few additional components, from a 0.4V - 2.4V voltage control signal. The MCU can generate the control voltage using PWM and filtering.This is actually something I've been thinking about, with an ATtiny and two encoders and AL8805s, for a bedtime reading lamp (and a floor reading lamp with two goosenecks). I'm just not an EE myself, so I'm going about it rather trial-and-error. The reason for the MCU is that I want very soft-on and soft-off, ramping at a slow rate over a second or so. Otherwise you could just use a potentiometer in a voltage divider to control the AL8805. The MCU won't use much power, but it'd be nice if it could be powered from the same supply as the LED(s), 6V to 36V.

author: romhunter
author_rank: Regular Contributor
timestamp: March 14, 2019, 03:58:56 am
content: I'd like to add a few idea of my own:- 1-wire sensor(s) to UART/SPI/I2C converter. As much as I love 1-wire, they just suck if you decided to use a RTOS on your micro, or just have too much interrupt. And they can't generate interrupt themselves.- Rotary encoder debouncer: Debounce the rotary encoder signal (after using RC filter) and send a clean signal to the main micro.

author: chickenHeadKnob
author_rank: Super Contributor
timestamp: March 14, 2019, 10:56:15 pm
content: Quote from: romhunter on March 14, 2019, 03:58:56 amAlong these lines I remembered a project from Matseng on the Dangerous prototypes forum/blog. I think he is also a member here. He called it a Digi-pot:http://dangerousprototypes.com/blog/2013/01/17/digipot-assembled/http://dangerousprototypes.com/blog/2012/12/24/pcb-a-week-2-digipot/Unfortunately the LED 3 digit 7-segment display requires more cpu pins than your pin budget allows. As I pointed out to Mats It could also be turned into a PID controller, but that would be creeping feature-itis. I find software only debouncing very reliable and prefer it to hardware debounce.

author: romhunter
author_rank: Regular Contributor
timestamp: March 15, 2019, 04:10:19 pm
content: Quote from: chickenHeadKnob on March 14, 2019, 10:56:15 pmI find it to be opposite. I hate doing software debounce, and avoid mechanical switch at all cost.Do you mind sharing your debounce function? I'd love to see your implementation (I never has a good software debounce experience before, it always bouncing around).And I just found out I've been IP banned from DP forum. Like, why? Do they just randomly pick my IP and ban me from their forum because... well, they want to? Cuz I remember the last time I went to DP forum was around 2-3 months ago, and I don't even mess around! Just purely looking at the page!

author: rhodges
author_rank: Frequent Contributor
timestamp: March 15, 2019, 04:54:38 pm
content: Quote from: romhunter on March 15, 2019, 04:10:19 pmHere is the polling function from my 4x4 keypad library. The poll function is called every millisecond, but actual polling of 4ms and a 40ms debounce works well.Code:#define KP_DEBOUNCE 40 /* debounce count in milliseconds */#define KP_KEY_REL /* notify when key is released (bit-7 set) */#define KP_POLL_MS 4 /* actual key polling rate, milliseconds */void keypad_poll(void){char key;poll_count--;if (poll_count)return; /* no need to check every millisecond */poll_count = KP_POLL_MS;key = check_key(); /* get key from current column, if any */if (!key) {if (!bounce) /* key released? */return;bounce--;if (bounce) /* not debounced yet */return;#ifdef KP_KEY_RELadd_key(curkey | 0x80); /* notify that key is released */#endifcurkey = 0;return;}reset_cols();bounce = (KP_DEBOUNCE / KP_POLL_MS);if (curkey == key) /* key still pressed */return;curkey = key;add_key(key);}

author: IDEngineer
author_rank: Super Contributor
timestamp: March 15, 2019, 07:30:25 pm
content: Think of them as "Reconfigurable glue circuitry so the inevitable Sales&Marketing-driven revisions can be prototyped, tested, and put into production in far less time, at far less cost, and without revving the PCB and schematic"....or "A single, shared PCB and schematic that can be shared across multiple products to drive down the number of distinct SKU's, drive up volumes on that smaller number, and thus leverage economy of scale".

author: Warhawk
author_rank: Frequent Contributor
timestamp: March 15, 2019, 07:32:47 pm
content: I use the 10F322 in this project:http://panacek.net/post/magsw2a/You can also compare it against the v10a version with a D-flipflop which is shown in a different artile on that very page.

author: mariush
author_rank: Super Contributor
timestamp: March 16, 2019, 12:33:04 am
content: Quote from: Warhawk on March 15, 2019, 07:32:47 pmIt's a bit off topic, but is there any particular reason you didn't use something like PIC10F320 (/2) or PIC12F1571 and just skip the 3.3v linear regulator altogether?The PIC12F1571 has 10bit ADC and you can set the internal voltage reference to 1.024v or 2.048v and runs with up to 5.5v and it seems that DRV5032 can also work with up to 5.5vAnd this chip has 256 bytes of SRAM and 128 bytes of 100k write flash, so you could probably also add a feature like log the last 50-100 measurements that are different (within +/- a few bits of tolerance) and when you push a button, the led could be used to flash the values (a basic led to 9600 baud serial or whatever adapter would be super cheap to make)

author: Warhawk
author_rank: Frequent Contributor
timestamp: March 16, 2019, 12:29:54 pm
content: Quote from: mariush on March 16, 2019, 12:33:04 amGood comment. The main reason for the LDO is that the input can go up to 18 V, Even the typical R/C system operates with voltages close to 6V when the receiver battery pack is fully charged. Also, more and more fiends have been using 2x LiFe battery. The second reason is that the internal voltage reference is incredibly inaccurate. I was surprised that Microchip specifies-8 + 6% tolerancefor the 10F322 and +/-4 % for the 12F1571! This is rubbish. The LDO I am using is 1% tolerance output.I have always wanted to do something with the 10F family and this was the first project where it actually made sense. There is something special regarding the 6-pin microcontroller.I also have a more adanced version with even current sensing and that one uses 12F1572

author: RES
author_rank: Regular Contributor
timestamp: March 16, 2019, 03:32:03 pm
content: Quote from: romhunter on March 12, 2019, 09:13:42 pmCreate a complex sound effects generator (PWM+RC filter output(s) based on a software DDS (direct digital synthesis).You could, for example, replicate sounds from an old SN76477:https://en.wikipedia.org/wiki/Texas_Instruments_SN76477

author: Assafl
author_rank: Frequent Contributor
timestamp: March 19, 2019, 06:53:15 am
content: I was annoyed with a timer on a coffee grinder... It was annoying that you had to set a time which was either too long or too short.So I used an ATTiny, a Hall Effect current sensor, and a relay to measure current, calculate RMS current (it used chopped DC so had to use RMS) to decide when the grinder was done and stop it.Simpler than a timer, cheaper than a timer, is never too long or too short.And, since I had a CPU I added: a diagnostic LED, variable threshold, pulsing the grinder twice after grind to clear stuck grounds...