Starting with microcontrollers - Page 1
Forum section: electronics / general

author: akis
author_rank: Frequent Contributor
timestamp: June 28, 2014, 11:31:42 pm
content: I am thinking of starting with a simple microcontroller for a device that I am making and it seems it would be easier done in programming rather than analogue.I think the materials I would need would be the programmer and preferably on USB, the PIC itself, and some guides to read. I know C and assembly so the programming aspect should be the easiest bit.I have looked at the PIC12F1572 (or similar) which is 8 pins only, DIP-8 package, has 4 A/D channels, 1 D/A as well, and it looks simple?I presume the onboard A/D will allow it to sense various voltages, eg from thermistors, and then take some action onto the A/D channel or may be it has dedicated output pins that it can control?As an example my need is for a control system to monitor 4 thermistors and depending on the temperature do one of three things: (1) do nothing, (2) increase power (3) decrease power.Many thanks for any pointers

author: dannyf
author_rank: Super Contributor
timestamp: June 29, 2014, 01:19:26 am
content: At a minimum, you will need a chip (the mcu), a power source, a programmer, a compiler and IDE.PIC has a large installed base but some hardware limitations. The worst of which is a lack of vector'd interrupt controller - you don't get that until PIC24. If I were to start today, I would pick the AVR in the 8-bit land (oro STM8), PIC24 in the 16-bit land and ARM in the 32-bit land.A power source can be a simple usb charger, or a battery pack.For PIC, the PICKIT2 is very good but with limited support for new devices - you should check if your particular PIC is supported by it. Otherwise, get a PICKIT3.XC8 is the latest compiler for newer chips and offers fairly good performance even in the free mode.A good IDE is a fairly severe downside for PIC. MPLAB X is simply unusable to me in terms of long delays in start-up and at compilation. MPLAB is severely 1980s. Because of that, I usually use PICC compilers and limit myself to older chips.For AVR, I would recommend CB + gcc-avr / Atmel AVR toolchain + Arduino boards + USBASP programmers, particularly because you have C background. Those arduino boards are incredibly cheap. They have most of the necessary parts on them, like oscillators + regulators + headers - connect a usb cable and you are ready to go. I usually get those boards cheap and blow out the arduino bootloader and use them as AVR boards.If you have to stay with PIC, I would recommend PIC24 + emBlocks (a variant of CB). It is light years ahead of anything Microchip has to offer.It is fairly easy to do what you wanted, in either PIC or AVR/Arduino.

author: mariush
author_rank: Super Contributor
timestamp: June 29, 2014, 01:46:02 am
content: avr: atmega, attiny etc - cheaper programmer, more expensive chipspic: a more expensive programmer (pickit3), cheaper chips (from about 35 cents and up)For simple programs, you'll be just fine with mplab x and xc8 compilers.I think a Pickit3 is a good investment, it's worth it.ps. Go straight for a pic16f, no reason to pick a pic12, not much of a price difference.

author: nctnico
author_rank: Super Contributor
timestamp: June 29, 2014, 09:01:05 am
content: I'd go for an MSP430. Nicer architecture and better analog performance.

author: 22swg
author_rank: Frequent Contributor
timestamp: June 29, 2014, 09:30:18 am
content: Akis. I started with assembler and PIC16F84 back when... Now getting good results & fun with PIC24FV32KA304 and MPLABX 2.10 and PK3 . my C is that of a 4 year old, but that's how you learn, MPLABX seems to run better on XP / win7 I try not to import libraries , write subs and manipulate registers like in asm , I2C, serial , AD , RTCC . no problem.

author: Fred27
author_rank: Unknown
timestamp: June 29, 2014, 09:47:25 am
content: I'd also go for MSP430, although the main reason for doing so would be the cheap dev kits to get started and the really friendly helpful community at 43oh.com.

author: akis
author_rank: Frequent Contributor
timestamp: June 29, 2014, 10:34:30 am
content: Thanks for all the replies. I have only just started looking at it and have basic questions:1) The development kit would be a USB powered device which will communicate with the IDE/compiler/assembler so I could download code to it.2) The IDE is important and would make life easy with debugging, single step and so on? Can I download a few IDEs before buying anything to see which IDEs are better?3) Are there simulators so I could plug my IDE to a simulator and execute code without actually having the chip or the development kit? For example the Android development kit offers a simulator so you can try running and debugging your applications on a simulated Android phone (running under Windows).*****************In terms of on chip functionality:1) FLASH is persistent memory that I can write with the aid of the development kit board?2) RAM is volatile memory used by the CPU3) oscillator is important so we do not need to add external components4) A/D is important so the chip can interface with analogue circuits5) D/A is important so the chip can drive analogue circuits6) clock and word size (eg 8 bit or 32 bit) is unimportant unless we want to write very complicated applications? For example I cannot even imagine why I would need anything better than a 1MHz, 8 bit device. In the 80s those chips used to power personal computers. Can someone give me examples of what the extra bits/power would be used for?Thanks

author: nctnico
author_rank: Super Contributor
timestamp: June 29, 2014, 10:59:14 am
content: Quote from: akis on June 29, 2014, 10:34:30 amEase of programming. Soft floating point is not a problem when using an ARM for signal processing. Having more CPU power can be the difference between working 2 weeks to optimize an algorithm for integer only processing or spending 5 minutes on linking with a soft floating point library.edit:typo

author: dannyf
author_rank: Super Contributor
timestamp: June 29, 2014, 11:04:58 am
content: For most of the 8-bit chips, hardware debugging is generally not available or limited - STM8 being one of the exceptions.32-bit chips aren't superior to 8-bit chips for most of the applications and can be much more of a challenge for a newbie. Starting on 8- or 16-bit in my view is the way to go for most people.

author: mariush
author_rank: Super Contributor
timestamp: June 29, 2014, 12:25:17 pm
content: 1) The development kit would be a USB powered device which will communicate with the IDE/compiler/assembler so I could download code to it.Pickit3 connects through USB and you connect it to your microcontroller on a prototyping board using 4 wires. Easy to program to, easy to read from. it's straight forward.Arduino boards have a usb to serial chip (either a ftdi chip or a another atmel chip) and the microcontroller on the board has a built in bootloader which lets the IDE transfer code to the board. If you get a single microcontroller and put it on a prototyping board, you need a programmer.. the serial based ones are cheaper, usb based ones are pricier.2) The IDE is important and would make life easy with debugging, single step and so on? Can I download a few IDEs before buying anything to see which IDEs are better?On PICs, MPLAB X is free, you can download it from Microchip. Same for XC8 compiler. You can play with it without having pickit3 or microcontrollers. You can also evaluate MikroC Pro for example, to have a feel about other IDEs:http://www.mikroe.com/mikroc/pic/On AVR, the Arduino IDE is very light. You can download the Microsoft Visual Studio based IDE for AVRs and try that out as well. I don't have much experience on this area, I work mostly with PICs. Mikroe also has lots of stuff for AVR, you can try those as well:http://www.mikroe.com/mikroc/avr/3) Are there simulators so I could plug my IDE to a simulator and execute code without actually having the chip or the development kit? For example the Android development kit offers a simulator so you can try running and debugging your applications on a simulated Android phone (running under Windows).On PIC, I didn't have the need for a simulator so I never search for one. AFAIK debugging is a bit limited on 8 bit processors but you can write to a microcontroller and step through instructions and stuff like that. I know there's something in the MPLABX about simulated chip, but I never tried it. There's third party simulation solutions like Proteus VSM for example :http://www.labcenter.com/products/vsm/pic16.cfm1) FLASH is persistent memory that I can write with the aid of the development kit board?Flash is where the binary you make is stored. You can write to Flash using your code, but you have to be careful not to overwrite parts of your binary that's stored in the microcontroller. Also depending on what microcontroller you plan to use, writing to flash is a bit complex and the functions would take up a bit of flash memory so on microcontrollers with very little flash space, it may not be worth it.If you need to store something in the mcu temporarily, you could use built in eeprom more easily but that one has different characteristics (slower than flash)2) RAM is volatile memory used by the CPUGenerally there's very little ram on 8bit microcontrollers, the cheapest PICs for example could have as little as 24-32 bytes of RAM.3) oscillator is important so we do not need to add external componentsMost microcontrollers have built in oscillator that's within 1% or less accuracy and stability. If they don't have built in, (at least the pics) you can use a separate oscillator or you can fall back to internal or external RC.4) A/D is important so the chip can interface with analogue circuitsMost mcus have them. Some of the cheapest or with few pins don't have adc, but you can just check the specs. At least microchip has hundreds of versions and variants.5) D/A is important so the chip can drive analogue circuitsThis.. you have to be careful about. DAC is not as common as ADCs in microcontrollers, fewer mcu actually have it. However, you can produce a variable voltage out of a microcontroller by using PWM and a few external parts, or you can just buy a separate DAC (microchip makes them and they're not expensive) and connect the DAC to the mcu using spi or i2c.6) clock and word size (eg 8 bit or 32 bit) is unimportant unless we want to write very complicated applications? For example I cannot even imagine why I would need anything better than a 1MHz, 8 bit device. In the 80s those chips used to power personal computers. Can someone give me examples of what the extra bits/power would be used for?On PICs, the instructions can take more than 8bit in the Flash memory, it's common to see 12bit or 14bit but when you choose a microcontroller the flash memory size is specified in 12bit or 14 bit words so you know exactly how much you could theoretically write in it. For example on thisPIC12F1571you can see it has 1.75KB of flash memory and you see there it says 1KB x 14 bit so you can in theory write to it 1K of 14 bit instructions.But when you write C code, you don't care about that, you have the same char, int, long,float etc that are 8bit, 16bit, 24bit etc the only situation where it may matter would be if you want to write to the flash. Only if you write straight assembly you may care about it.The frequency matters mostly when you have a lot of stuff to be done within a time frame. If you only need to do a few things repeatedly, 1 Mhz may be enough, for other situations you may need more.On PICs, most instructions take 4 ticks and a few take 2 ticks of an oscillator, so depending on your oscillator frequency you can estimate how much stuff you can do in a second or a time frame.. at 1 Mhz you'd have at best 250k instructions executed in a secondYou can do a lot of stuff with 8bit microcontrollers. When you get to more complex stuff, you may want 32bit mcus which are more compiler friendly meaning they have more hardware functions optimized for C compilers and they have some improved functions like interrupt vectors with several levels. Those make for example running a very light operating system possible on such 32bit microcontrollers, whereas it would be very hard if not impossible to run an OS on a 8bit mcu.Somewhere in between, chips like PIC24f have some dsp functionality or allow you to rearrange the pins the way you like it (there's some 8bit chips lately that also allow you to partially or fully rearrange the i/o pins)

author: lgbeno
author_rank: Frequent Contributor
timestamp: June 29, 2014, 12:46:24 pm
content: Checkout the MSP430 Launchpad. TI has quite a bit of supporting documents and tools as well.You can also do Energia with MSP430 which is the same as arduino.Also choosing a micro isn't marriage, try one see how you like it and if it falls short, find another

author: Psi
author_rank: Super Contributor
timestamp: June 29, 2014, 12:59:02 pm
content: Quote from: akis on June 29, 2014, 10:34:30 amAs soon as you starting needing to do math on floating point numbers you run into issues with a 8bit cpu.Floats are 32bits long so the CPU has to do multiple 8bit operations to do one simple add/sub/mul/div on a floating point number.Now combine that with the fact that most mcus don't have a divide instruction, they simulate it with even more 8bit add/sub/mul/shift operations.So here you are, trying to code some formula using floating point variables, like maybeResult = (sqrt((MyFloat1 * (MyFloat2*MyFloat2)) / MyFloat3)) * 3.14159And suddenly the MCU is bogged down running through 1000's of 8bit add/sub/mul/shift instructions to calculate your one line of C.The result is understandable, it runs very slow.I'm exaggerating a little, its not quite that bad, but you get the idea.32bit cpus are much faster to work with 32bit variables

author: 22swg
author_rank: Frequent Contributor
timestamp: June 29, 2014, 01:04:40 pm
content: Take a look at Microchip DM240013-2 its a Microstick PIC24FV, ticks all your boxes , and plugs into a bread board , has its own programmer / debugger and USB cable and 5V cost < 20 GBP.

author: Rasz
author_rank: Super Contributor
timestamp: June 29, 2014, 01:34:59 pm
content: just buy few starter kits and try them, most are $5 anywaysomething like arduidiotini pro mini +usb programmer is ~$5 on ebay

author: dannyf
author_rank: Super Contributor
timestamp: June 29, 2014, 02:51:36 pm
content: QuoteWithout FPU, the 32-bit chips aren't that much faster t han a PIC18F (or AVR) for floating point math, when the clock speed is matched.32-bit chips win in terms of execution speed primarily due to their much higher clock speed.

author: nctnico
author_rank: Super Contributor
timestamp: June 29, 2014, 03:15:52 pm
content: Quote from: dannyf on June 29, 2014, 02:51:36 pmThat makes as much sense as stating that a Ferrari is just as fast as a Model-T Ford when they travel at the same speed

author: dannyf
author_rank: Super Contributor
timestamp: June 29, 2014, 03:57:20 pm
content: QuoteIt depends on the driver. Grandma on her lawnmower can certain outrun you in your Ferrari, for example.

author: andyturk
author_rank: Frequent Contributor
timestamp: June 29, 2014, 05:05:03 pm
content: Quote from: akis on June 29, 2014, 10:34:30 amWorrying about word size and MHz is a waste of your time at this point. The first thing you ought to do pick an IDE that you're comfortable with. You're going to be spending 95% of your microcontroller "play time" in that development environment and not so much time actually touching hardware. All microcontrollers can blink LEDs, and most have some sort of analog capability, so pretty much any mcu out there is sufficient for learning the basics.Pick an IDE that makes you happy (mine is emacs) and let that choice dictate the hardware behind it.

author: nctnico
author_rank: Super Contributor
timestamp: June 29, 2014, 06:45:00 pm
content: I agree you have to start somewhere but choosing a microcontroller based on the IDE is like chasing blinking beads and mirrors. Some IDEs may take some time to learn. The bottom line is: there is a good IDE available for every microcontroller so the IDE doesn't need to drive the choice for a certain controller.I'd look for a good path into the future where more demanding requirements don't mean changing to a completely different architecture. At the moment ARM based controllers cover the widest range of microcontrollers you can get. From 8 pin DIP to >200 pin BGA. IMHO getting a simple low end ARM controller up&running isn't any different from getting an MSP430 going.edit:I think it is a good idea to get some starter kits for several ARM controllers from different brands and start with those. When I looked into switching from MSP430 to ARM I played with controllers from several different first before settling on one particular brand. There is a huge difference in ease of programming the flash, quality of documentation, quality/useability of the peripherals, etc.I know I wrote about the MSP430 before but that may run out of steam if projects get more complicated. It is easier to use an ARM controller for an easy task than to use an MSP430 for a difficult task.

author: andyturk
author_rank: Frequent Contributor
timestamp: June 29, 2014, 09:39:54 pm
content: Quote from: nctnico on June 29, 2014, 06:45:00 pmI was resisting the urge to say (again), "Go buy yourself a STM32 disco board for $15 and be done with it."That tends to bring out the torches and pitchforks around here. Or should I say PICforks.

author: nctnico
author_rank: Super Contributor
timestamp: June 29, 2014, 10:12:27 pm
content: Based on what I have read in similar threads the microcontrollers from ST don't seem like a good place to start. Some call their libraries and peripherals complicated. Recently I looked at the LPC800 from NXP. NXP claims they have made this controller as simple as possible to be an easy start. The ROM in this controller contains drivers for the PLL, UART and I2C interface.

author: andyturk
author_rank: Frequent Contributor
timestamp: June 30, 2014, 01:55:06 am
content: Quote from: nctnico on June 29, 2014, 10:12:27 pmSounds a bit like the Tiva chips from TI (ARM Cortex M4F). They have a fairly extensive library of code in ROM, including drivers for pretty much every peripheral. You don't have to use the library routines, and they don't take up any flash.The LPC800s appear to have a GPIO switch matrix meaning you can assign just about any peripheral to almost any physical pin. That's a super-handy feature and also very nice for beginners, especially if you're building your own boards. The Nordic nRF51 chips (Cortex M0 + bluetooth) have the same kind of thing. The nRF isn't beginner friendly though.The PSoC4 series from Cypress (yet another Cortex M0) is also worth considering for beginners. It's got the same GPIO switch matrix, and even allows you to route analog signals too. They offer a$4 bare-bones dev board, a fancy$25 versionwith an on-board debugger. But as I was saying before, the accessibility of the development environment is more important than the silicon when you're starting out. Fortunately, PSoC Creator is easily one of the best microcontroller IDEs I've seen.It comes bundled with GCC 4.7 and is a really smooth ride for simple demo projects written in C. Compared to other OEMs, I think Cypress cares more about their IDE because it's required to access any of the unique functionality of Cypress' silicon. It's not an afterthought, and it's not a revenue center.You can export projects to IAR and Keil, but you still have to do the signal routing in PSoC Creator. It comes with tons of "datasheets" for virtual components that are built up from verilog and generated C code. Sounds scary, but it works really well.Check out the PSoCs!

author: Bored@Work
author_rank: Super Contributor
timestamp: June 30, 2014, 05:22:46 am
content: Quote from: andyturk on June 30, 2014, 01:55:06 amBut like with all ARM based processors it is not a walk in the park. TI screwed up a few things when moving/rebranding the library from SellarisWare to TivaWare, in addition to what they already had screwed up in StellarisWare. And the documentation is also typical. Incomplete, written in a hurry, and with the attitude that the MCU was hard to build, so it should be hard to use. Nothing out of the ordinary, but using the ROM functions essentially forces you to use TivaWare, because the ROM functions are just copies of the TivaWare functions.Among the things I check when looking for a MCU, despite cost, fit for the purpose, etc., is availability of a command-line toolchain (so it can be integrate in our build system and whatever IDE we want), and documentation. And lots of example code. I am not a fan of blindly copying code without understanding it, instead code examples for me are to cross-check and clarify the documentation.

author: bwat
author_rank: Frequent Contributor
timestamp: June 30, 2014, 06:01:47 am
content: Quote from: Bored@Work on June 30, 2014, 05:22:46 amSame here. Some of us were taught not to just write code if we could write code that writes code instead. So, I've got lots of little languages that generate C code which in turn gets compiled by the target compiler. This needs something like make. If I can't get at the compiler and linker from the command line then it's restrictive.

author: andyturk
author_rank: Frequent Contributor
timestamp: June 30, 2014, 06:15:13 am
content: Quote from: bwat on June 30, 2014, 06:01:47 amMake? Code generators? We're talking about blinky and noobs here. Don't make 'em cry!

author: eneuro
author_rank: Super Contributor
timestamp: July 01, 2014, 01:34:50 am
content: Quote from: mariush on June 29, 2014, 01:46:02 amEven this AVR ATTiny85 could do this job, with fast PWM on PB1 for power control or use PB1,PB0 for software I2CIt has 4 ADCs, but to use ADC0 on RESET pin High Voltage programmer may be needed for development if program reflash needed in the case of bugs.However, it is possible write its 8KB flash (512 bytes SRAM) using... old laptop with LPT port and a few resistors in AvrDude DAPA mode, using text editor to write C source code and compile under Linux of courseAVR Microcontrollers in Linux HOWTOSometimes such simple tools have advantage-you know exactly what optimisations are made and what is passed to the compiler if you can do it in a few shell commands or from makefile.Just finishing another project and pushed next ATTiny85 to the limits, but its 2 timers in fast PWM mode work as expected, so another DIP8 monster switched to internal 8 MHz clock is ready to go

author: akis
author_rank: Frequent Contributor
timestamp: July 01, 2014, 08:59:23 pm
content: My simulator supports the PIC16F84 complete with assembler, C compiler, debugger and sample sims. So I decided to start looking at the PIC16F84 first. I downloaded the reference manual and I must admit with over 30 years professional experience starting with Z80, 68000, 80386 - I am finding this manual the most stupidly and badly written piece of trash. Which must say a lot about the company behind it.

author: dannyf
author_rank: Super Contributor
timestamp: July 01, 2014, 10:54:56 pm
content: QuoteI think consensus seems to be that Microchip and Atmel both make fairly good datasheets.QuoteOr the folks making that statement.Or both.

author: mariush
author_rank: Super Contributor
timestamp: July 01, 2014, 10:57:55 pm
content: What do you mean by "reference manual", the datasheet or something else?I actually found the datasheet quite easy to understand, but I wasn't "damaged" by older architectures.// ps. The PIC16F84 is ancient. You really should look into something more modern.

author: boz
author_rank: Regular Contributor
timestamp: July 01, 2014, 11:50:58 pm
content: I'm the biggest Microchip Fanboy there is but seriously just get a base Arduino UNO1. The IDE is a bit simple and crappy but it works out of the box and its also real "C" your programming in just like the big boys2. There is a big community geared to newbies while you learn. (no ones going to jump on you if you ask a dumb question)3. Its cheap (about $15 for a UNO clone)Dont bother with anything more complicated yet such as an arduino mega, nanos or PIC ARM 'duino clones or you just end up with frustration due to 3.3V vs 5V or other silly issues, once you have got the basics you can move on to bigger/better AVR's PIC's, 430's or ARMS.

author: akis
author_rank: Frequent Contributor
timestamp: July 02, 2014, 12:01:49 am
content: Quote from: mariush on July 01, 2014, 10:57:55 pmNo, I am talking about the manual and the way it's thrown together, not the architecture which I can not express an opinion on as I have not seen enough of them.I am reading now the Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf and it's so much better (the document, not the architecture).

author: Kremmen
author_rank: Super Contributor
timestamp: July 02, 2014, 06:34:44 am
content: Quote from: boz on July 01, 2014, 11:50:58 pm+1 to this thought. And if you wish to improve on 1. above, there is a solution: grab the free Atmel Studio 6.2 and install the free Arduino extension from Visual Micro (available directly from inside AS 6.2 in the Tools/Extension Manager dialog). That links the AS 6.2 to Arduino IDe and then you can write you code in a "proper" IDE which is miles ahead of the original Arduino environment.

author: 22swg
author_rank: Frequent Contributor
timestamp: July 02, 2014, 08:34:08 am
content: Akis You seem to be starting from a strange angle, what is your purpose ?, learning about mcu from a software aspect , for a particular hw project or just to get up to date. you mention sim , this will help with finding bugs, but will not take the place of actual hardware, you can sim turning on a LED , but that's not to say it will actuall be ON . I also came from Z80 to 16F84 and you can do loads with it but not what you had in your list ? the "Manual" data sheet is basically a list of registers and how to set them up and use them , no more . I learned from code examples for asm and CLooks like some good advice posted below ....boz, I am the biggest MC fan

author: akis
author_rank: Frequent Contributor
timestamp: July 02, 2014, 10:11:25 am
content: After I decided to look into MCUs I discovered that my real-time, interactive simulator supports the PIC16F84A, complete with assembler/C compiler, real time debugging etc. Since I have to start from somewhere I thought it would be a great idea to go with what my simulator already provides, including samples, assembly files, ROM files, configuration files etc. I also downloaded MPLAB X but the simulator is so much better for just starting on a basic circuit, modifying the assembly file, running again etcAfter a while I needed the PIC16F84 reference manual to understand what the assembly was doing but I did not like it (hence my comments), so I gave up on it.As per your suggestions I started looking at the ATMEL tinyAVR ATiny25/45/85 which has a very nice datasheet (should be called reference manual but anyway).Once I am more familiar with MCUs my first project is to monitor 4 temperature sensors and then nudge up or nudge down the power of an amplifier. Because there is a lot of lag between changing the power and sensing some temperature change, it may even be an inverse correlation for a while, in other words, you sense the temperature is too high, you lower the power, and the next X readings are even higher. So unlike a current limit implementation where we adjust the current to stay below a level, and the feedback is instant, with temperature sensing the feedback is very very slow. If I employ an analogue solution, similar to current limiting, as soon as the temperature exceeds a threshold, the analogue system would switch the power off completely, because it will not be getting a quick feedback. So the device will be working in a "full power on" - "power totally off" cycle, which may succeed in keeping the temperature below a threshold, but is not what I want. So I thought an MCU would cope with this much better.As an example:1) get temperature reading2) if temperature greater than X, decrease power by 10%3) if temperature lower than Y, increase power by 10%4) wait 10 secondsThat simple algorithm may produce better results than I can do in pure analogue, although I am sure it can be done in analogue with clever circuitry.

author: nctnico
author_rank: Super Contributor
timestamp: July 02, 2014, 10:18:23 am
content: This sounds like implementing a (PID) control loop. It may take some math to get that working properly though. May I suggest the book 'Applied control theory for embedded systems' by Tim Wescott?OTOH with some understanding of control theory this problem can be tackled by analog circuitry as well.

author: akis
author_rank: Frequent Contributor
timestamp: July 02, 2014, 10:47:12 am
content: Maybe there is a simple and completely analogue solution. I have experimented with adding RC delays to forbid the circuit from going fully on or fully off, but with little success. Here is the thread I have just posted, more knowledgeable people than me might have solutions.https://www.eevblog.com/forum/projects/control-system-with-feedback-time-delay/

author: Monkeh
author_rank: Super Contributor
timestamp: July 02, 2014, 10:49:54 am
content: Quote from: akis on July 02, 2014, 12:01:49 amTake a look at the MSP430 documentation.www.ti.com/lit/ug/slau144j/slau144j.pdfwww.ti.com/lit/ds/symlink/msp430g2553.pdf

author: nctnico
author_rank: Super Contributor
timestamp: July 02, 2014, 10:57:06 am
content: Quote from: akis on July 02, 2014, 10:47:12 amFor this problem you need to understand/use control theory otherwise you are not going to crack it. Because of the huge lag between adding heat and sensing it you probably need some feed-forward compensation as well. If you know the thermal capacitance of what you are heating you can make an estimate on the temperature based on the amount of energy you put into the 'system'.

author: dannyf
author_rank: Super Contributor
timestamp: July 02, 2014, 10:57:49 am
content: QuoteWhat you want is a PID loop, which can be done either digitally (via an mcu for example) or analogly - tons of examples there as well.If you do it digitally, it can be implemented with either full-on/full-off, or via pwm. Either way, not much of a difference.