very interesting, i will and have to finish the course with this Fundamental of Designing with Microcontrollers. This is advantage in my case in the advancement of automation towards building services...
once again, i appreciate the value on how mr. jon delivered his presentation...
what I do most appreciate as well are all about peripherals accronyms have been identified clearly to understand that to be understood.
that's clearly great and appreciated. anyway, i have already downloaded the educational materials for references related to my job practice around environment.
What is the Physical Interface for USB and Ethernet. If I have a PIC18F2455 for example, what else hardware do I need for USB communication? (I dont mean power supply or OSC..)
Do the microcontroller manufacturers provide a kind of spice model or someting that can be use in a simulator to simulate their chips in a schematic circuit?
@clia: On slide 17, signal PWM0-RSSI In is a pulse train where the pulse width carries information. When passing across the filter, it filtered out the carrier frequency, and let the analog information (voltage proportiobak to pulse width) pass.
Thanks for the intro and looking forward to working through both this and the Advanced MCU courses. I do MCU programming as part of my job, but it is mostly self-taught so it will be good to go through this and cover things I may not have encountered.
Thanks Jon! Just catching up on these lectures now, but looking forward to the rest. Coming from a PIC and Arduino hobbyist background I'm interested to see what else is out there!
I learned about these lectures well after they occurred, and I was wondering if anyone goes back and checks on additional comments for these lectures for those of us that are listening to them from the archive.
Looking at microcontrollers from an FPGA perspective, how easy would it be to convert code written in VHDL into 'C' to port code to the microcontroller? What about I/O compatibilities?
Q: Hi, How do I listen the archived classes? I just can download slides. Thanks in advance!!
A: Hello. Check your audio config on your computer. I was able to click on the archived link and a separate page came up, complete with an Adobe flash player which played the DesignNewsRadio class excerpt. make sure you have the latest Adobe Flash installed.
The Motorola Micro controllers I started with were the 68HC11, 68HC16, and the 68HC332 and then went into automotive Engine Controllers with the MC555 series of controllers.
The time here is after 6:00 PM (1800h), so I've wrapped up answers to questions and am off to dinner. I have tried to answer most of the technical questions. If you didn't get a direct answer, I apologize. You can find a lot of information with a Google search and MCU-vendor Web sites and application notes provide much helpful information, too. All the best. --Jon
Q: How do we decide what is the minimum RAM and FLASH do we need before starting the project?
A: You cannot decide beforehand. It's best to look at an MCU that belongs to a family so you can go "up" the family tree to get more memory, or go down the tree to save money. It would be nice to have a code-estimation tool, but I don't know of one. Perhaps others have ideas they can share.
Q: Are the two differential lines in CAN bidirectional??
A: There is a difference between the two signals as shown on Slide 23 for a logic 0. The idle--logic-1 state--keeps both lines at the same voltage. There are only the two signals shown.
Q: What is the main difference between I2C and CAN? Their block diagrams seem to be
the same.
A: Use I2C for short-distance chip-to-chip communications. I2C devices use a common clock signal, CAN does not. Use CAN for longer-distance comms between a computer and a machine-tool, for example. CAN uses a sophisticated protocol that included a cyclic-redundancy code, error flags, acknowledgements, message identifiers, and do on. It's a robust form of communications.
Q: is usb an extenal hardware to a MCU or just a software?
A: Actually both. The MCU provides the hardware that implements the bus timing and a state-machine. For information, see the PIC18F2455 data sheet at: http://ww1.microchip.com/downloads/en/DeviceDoc/39632e.pdf. Also see Jan Axelson's book "USB Complete." You need a good knowledge of how the USB operates before you implement it. You will need a software stack, too.
Q: Is it possible to change priorities for one-vector interrupts?
A: Yes, you just change the order in which you test the flag bit for the devices that can cause an interrupt. To give a UART higher priority than an ADC, you test the UART flag first and if it is set, you run the UART-related code. After you handle the UART interrupt you test the ADC flag, and so on. The last flag you test has the lowest priority.
Q: What is the input range of the ADC? What is the educational value of the kits you presented.
A: The input range has a maximum of the supply voltage of the microcontroller. An MCU with a +3.3-volt power source cannot accept a voltage over 3.3 volts on any input, although MCU manufacturers include a bit of tolerance. The ADC range depends on the reference voltage, so read the data sheet for the MCU you plan to use. For a 2.500-volt reference, for example, you can digitize a signal between 0 and 2.500 volts. Some MCUs have an internal reference you can select, or you supply an external reference.
Q: Typically, does the MCU have a higher power requirement than the CPU?
A: Most MCU manufacturers don't specify the power drawn by the CPU alone. Perhaps you mean does a microprocessor draw more power than a microcontroller? Yes, usually. a high-end Pentium-class MCU needs a heat sink. MCUs do not.
Q: Are there MCU that can drive a 110V motor directly, or would you interface through solid state relays?
A: A solid-state relay would be good. You could also use an MCU to trigger a triac through an opto-isolator. I have seen some schematic diagrams that use an MCU to directly drive a triac, but in the interest of safety, I'd want an opto-isolator, or opto-coupler between my MCU and line voltage. Do a Google search for microcontroller triac optocoupler.
A: Yes. Here's a Microchip PIC application note about PID loops: http://ww1.microchip.com/downloads/en/AppNotes/00964A.pdf. Do a Google search to find other app notes.
Q: Can you prevent Interrupt priority inversion with a watchdog timer?
A: Sure, that's one way to do it, but the watchdog timer will run continuously, which can make debugging a pain. Right in the middle of some debugging, the WDT can trigger a reset. Priority inversion occurs when a low-priority device monopolizes, or blocks, a system resource that a higher priority device needs to use. One way to prevent priority inversion is to write short interrupt-service routines. A real-time operating system or scheduler can help reduce this type of problem.
Q: arduino board programming is supiorior than basic ATMEL board programming?
A: It depends on what you want to do. The Arduino uses an Atmel Atmega 328P MCU and the Arduino has easy-to-use tools, so if you want to start learning, the Arduino board will do nicely.
Q: I disagree, I think as Jon is saying, jumping in and using Arduino is better than trying to pick up plain C and using a uC from scratch.
A: Yes, that's correct. The Arduino or mbed boards provide a good "sandbox" in which you can try things, learn from others, and do real things. The tools are free and have a lot of support.
Q: For a mechanical/biomedical engineer with little background in electronics, what would you recommend for me to come up to speed?
A: Take a look at the BASIC Stamp modules and educational materials from Parallax: www.parallax.com. The BASIC Stamps provide a good way to get started and Parallax has many books about electronics. I also recommend the book, "Make: Electronics," from O'Reilly Media, ISBN: 978-0-596-15374-8. It's an excellent book with many helpful illustrations and diagrams.
Q: Question for Slide 14: What are typical maximum intervals for timers? µs, ms, s, min?
A: You determine the intervals by the clock source you select. Most MCUs use the system clock and divide it by a value you set, likely a power of 2; that is, divide by 2, 4, 8, 16, etc. You can use an internal timer to click every 1 msec, for example, and then every time the timer ticks over, increment a counter. Then after 10,000 counts you have a 10-second period. The timers and counters are very flexible.
Q: With SPI, can you have one master and many slaves?
A: Yes, but you need a chip-select signal to enable or disable each SPI slave. That means you need an MCU output for each external SPI device in addition to the SPI communication signals.
Question: In industrial automation, do microcontrollers find use in developing smart sensors? Are FPGAs anothoer solution for embbeded programing.....and if so how do I decide - FPGA vs microcontroller?
Answer: Yes, MCUs fit nicely into smart-sensor applications. They have memory for code and, if necessary, can linearize sensor outputs to convert them into units such as pounds, newtons, mm mercury, PSI, etc. I think an FPGA would be overkill for a smart sensor.
If you had to choose between SPI and I2C on a single board, which one would it be?
I'd use SPI if I had one or two chips and only needed simple transfers of data from one internal register. Use I2C if you have a chip such as the Analog Devices AD7991, which has several registers to set operating modes. I2C is the only way to connect to it. Look for the external devices you need first and let them govern the type of MCU interface you need. --Jon
Well we're talking about embedded stuff here. You want to squeeze the maximum amount of computing you can out of a system. So it's kind of "required" that you "build the op-amp" to do so. Libraries are fine if your applications don't change much from product to product.
@s.schmiedl It's nice to know what the basic internal operation of an OpAmp, but it kind of helps when you can get one from a grat company when the objective is assembling a guitar amplifier instead of assembling an OpAmp.
@nateholio I agree that letting everything be just a lego is not good, but some libraries are very useful. I tried working with no libraries at all and some things become just a waste of time, reinventing the wheel. Using a library would speed up the work and maybe its implementation was already tested and checked by many other people, granting me some assurance of its quality.
It can still be manageable and error-free if you code your own subroutines/ISRs/&&c and use those as a base for programming on top of.
@franch...I mean an enviornment where you have a bunch of libraries full of lego blocks and you just have to put them together in the right order to make what you want. Not even a need in some applications to know what an ALU, barrel shifter, I/O address for a control register is, &&c anymore.
too many hidden fiddly bits and magic switches. I'm not sure how much longer I will be able to be part of a culture where n errors in m lines of code is considered acceptable. MCU code, at least at my current level, is of a size that is manageable
let me try a second answer: MCUs are simple enough to be efficiently programmed by humans. And I'm getting too old for plugging all of those fancy libraries together in just the right way ...
Jon mentioned timers...depending on the uC this might result in code that is more simple than using IRQs. However, you will eat up power every 100ms. If battery life is your concern then I would go for IRQs
@s.scmeidl As an example, I made a simple system with AT89S52 with a 16-key keyboard with and LCD display to show the input and 2-buttons on the interruptions to scroll up and down the display. I looped they keyboard to read the input, but I needed the scroll to work right away, so they were plugged in the External interruptions.
Button presses a few times a day. I'd put the MCU into a deep sleep to save power and wake it upon receiving an interrupt from the button. This assumes the MCU doesn't do anything until someone presses the button. You also could set a timer to wake the MCU, say, every 100 msec and check the button.
assuming the processor is asleep most of the time and drawing low power an interrupt will use less power than polling would especially if only 4 events per day are required.
I'm considering battery life. The MCU would basically be waiting ... the high point of its day being sounding a piezo speaker when the button press is late :-)
Yeah, choosing the wrong PIC can be a hassle. I recently had to dig through nearly all the PIC16s just to find out that NONE of them had proper Multi-Master I2C support.
@s.schmiedl This type of thing depends. If you need the button to stop whatever the MCU is doing to process its request, you should use an interruption. If you can loop and read those buttons indefinitely, there's no need to interrupt the MCU.
Watch out for some of the PIC MCUs. I have experimented with the PIC16F690, for example, but to use the MPLAB debug capability I would need a DIFFERENT 16F690 chip with more pins that provide access to internal MCU debug functions. Microchip offers that "special" chip on an adapter board that takes the place of a regulat 16F690 in your system. So, you need the adapter and a cable for some Microchip MCUs. Look closely to find out what you need to use ALL of the capabilities in MPLAB and other integrated development environments. You can't just go out and buy "stuff." It takes some research. I'll talk about these aspects in other sessions this week.
Thanks Jon and Tekhunter. I need large code space tools as I try to use MCUs as dedicated MicroProcs. GCC seems to work well, but the Atmel Dragon is iffy for me!
Clang is BECOMING a universal compiler for C. It's not there yet, but it does currently feature ARM support (Apple uses it for iPhone), and it's also built as a drop-in replacement for GCC.
If you use an FPGA, you can try out different IP cores... the performance may not be identical to the respective processor, but it could be representative.
There are no universal compilers I know of. The GCC tools come the closest but you need a library for each type of MCU. You can get tools from IAR, Rowley, CodeSourcery, and others that let you work with different types of MCUs, but the tools are expensive unless you use the code-limited versions.
Great session. Thanks for having these! I am interested in getting credits for these sessions. How exactly do we get credit? Is there a certificate, or something? Thanks again.
Are there simulation software platforms available to assist with prototyping prior to commiting to a particular microcontroller within a manufacturer's product range?
Not that I know of unless you want to buy The MathWorks MATLAB and Simulink, which are expensive. Those tools let you simulate a complete system. I suppose you could also use National Instruments LabVIEW. I don't know how well either set of tools would simulate a small MCU. They handle mainly high-level control systems.
Inexpensive dev systems? TI has free limited code-space versions of Code Composer Studio. The Renesas HEW IDE is free and has no limits, as far as I know. The AVR Studio is fine, too. Several people have noted the GNU Compiler Collection (GCC), also free and available for many MCU families.
Are there simulation software platforms available to assist with prototyping prior to commiting to a particular microcontroller within a manufacturer's product range?
The GCC toochain IS a pain to set up and use, but once you have it set, using it with the Eclipse IDE is a pleasure. Especially for debugging step-by-step. And really especially if you don't have a lot of money to spend with Kiel.
Jon, do your have suggestions for inexpensive dev systems? I choose Atmel AVR Studio as we do very short runs, the Studio is free and has a C interface. Microchip was outside of my boss's budget.
Regardless, buying an IAR toolchain, or something from its competitors, isn't cheap, and not easy to do if you're just getting started, and can't yet justify the investment. The mBed board can be good, but you can't do assembly through the web IDE. :P
@wessoufi Yes, it will. Actually, there is already an Archived Classes option in DigiKey's continuing education center menu. I guess the classes will be eventually archived there. :)
Many of the FPGAs available have either a hard-core or a soft-core MCU. You buy FPGAs with hard-core MCUs and use a program library to implement them as soft cores. I have experimented with the Altera Nios processors but haven't used one in a design. Worth looking into if you need additional capabilities for an MCU but want everything in one chip. --Jon
Jon, that's because you got the compiler from IAR, instead of trying to find an existing gcc toolchain. If you try the latter route, you aren't very likely to find a toolchain that meets unusual requirements.
I haven't looked at Space-grade MCUs, but you might find larger companies such as Cypress, TI, Renesas, and Freescale have space-qualified MCUs. I know the amateur-radio community has put small communication satellites in orbit with MCUs, so they must exist. Jon
Question: ARM chips can be a royal pain to get started with, if your chip or library requirements are odd; you need a completely different version of gcc just for every little thing. :P
Answer. I just worked with an ARM-based MCU from Energy Micro and had no problems with the libraries for the IAR compiler. They did what I expected and made it easy to configure the chip. Energy Micro could give more information about some aspects of using the peripherals, though.
In industrial automation, do microcontrollers find use in developing smart sensors? Are FPGAs anothoer solution for embbeded programing.....and if so how do I decide - FPGA vs microcontroller?
Some tools, such as the Microchip MPLAB, include simulators that let you give your code a preliminary test before you load it into an MCU's flash memory. I have not used that simulator, so I can't tell you how well it workd. I'm more of a load-it-and-try-it guy. --Jon
Hi All. Let us not flood the chat window with trivial questions like is C an OO language, etc. We should respect the time given by Jon to us and ask relevant questions only..
I agree with thimme this is crazy communication One-To-Many as in the babel tower passage. It is very difficult following replies to questions. Is there any way to reconfigure this for future webinars?
C programming for embedded systems is the same as C for any other application. But, embedded systems reguire more interaction with and knowledge of the underlying hardware. __Jon
@wessoufi The greatest difference I felt between C and "embedded C" was that for MCUs, C works on even lower levels. There is a greater need to work with registers and bitwise operators.
CAN vs. RS485. The RS485 spec only controls the signaling levels and doesn't offer a protocol or even compatibility with other devices. I like CAN when the communications require several drops, device addressing built into the protocol and communication priority. Look for a short CAN tutorial on the Internet. --Jon
For timers, your low end resolution is constrained by the clock speed your timer is being run at. The high end you can use counters to further enhance your timers. So if you have a timer that clicks off every 100ms, you can count those ticks with a basic int and track seconds, minutes, hours, days, years, eons, etc.
I'm not a C+ programmer, so I can't comment with any knowledge about using C instead of C, but someone noted the use of C when they have many structures. That seems like a good reason to use C . --Jon
ARM chips can be a royal pain to get started with, if your chip or library requirements are odd; you need a completely different version of gcc just for every little thing. :P
Thanks Jon, is there any difference between the main mentalities of CAN and RS485? I mean what is the aim of CAN? To do a differential comm. in the low level easily?
@steinb86: See if your local community college offers intro ee classes. Analog is probably the most useful for biomedical engineers, depending on what you're doing.
mike_rossiter, I would think those qualify as a one-off, and essentially a rapid prototype. I was referring more to something to be mass-produced. But good to know Arduinos are doing actual work. :)
@TT: I use arduino in a professional setting, they're great for building test fixtures. I haven't done product development with them, but I've seen lots of people building very involved devices with the available shields.
; no, the traces have their own cap values from your pcb design. you can not kill that. try to minimize the legth and the numver of vias in the path to your chips.
I like COde composer better. I dont use much of Grace because I like the register writing. Yes the Code composer will do everything up to some code size limitation for the launch pad. I dont think that any of the microcontrollers suported by the lauch pad have more memory than the free code composer can compile.
@mike_rossiter Yes i agree. I try to tell beginners who really want to understand to stray away from arduino's until they understand the innerworkings of ucs. Takes away from learning what is really going on i think
slk, my point is, you could use two resistors of twice that value, or 4 resistors of 4 times that value. My question is, does this kill the capacitance buildup, or is it just wishful thinking?
@jruddy34: it's not that arduinos are too easy, it's more that the bootloader program prevents you from doing real time stuff. Interrupts are practically useless.
On the flip side, you can use the Atmel programmer instead of the Arduino development environment and take advantage of the hardware.
; you MUST have the Rp resistors just once on your entire I2C bus, most of the time close to the controller side. usually, 1k78 would work all the tyme.
slk, I mean for lots of I2C devices over larger distances. The capacitance of the signal lines build up. I'm guessing, but I think that if you had lots of high resistors, maybe one for each device in parallel, the capacitance of the signal line might go down, allowing longer length and more devices.
@kenstan No. There are some MCUs that don't come with USB interface out of the box. In these cases, you would need to implement the USB by yourself (or using help from the internet :P).
CAN uses differential signals, meaning two lines are used for signals. There is no clock, similar to UART. This is useful for transmission over cable, as devices can be at different grounds and still communicate over the network.
I2C uses two lines also, but in this case one is for the signal, the other is for the clock. This is useful for use on a PCB where all IC are connected to the same ground.
Has anyone tried getting around the I2C capacitance problem by just using large resistors in parallel, so the total resistance is correct, but the capacitance gets killed?
@Tenacious. Thanks. Yes. That was my doubt. Not only that can this scenario support master read/write from multi slaves/masters' register data.. anyways i think i need to read more to find it out.
franchzilla, the limits of I2C have more to do with the analog properties of the bus lines. If you can keep the capacitance down, your problems should go away.
Reyaz, the question you want to ask is whether the masters in CAN can address each other. Not sure, but Wikipedia might know that. I look up these busses on there pretty often.
If you want to know the differences between protocols, I recommend google. Elucidating the differences between teh two can be complex. Wikipedia is an excellent source of information.
@Tenacious Techhunter That was exactly the problem. But using many SPI devices can get you out of pins in the MCU. But, again, I'm used to the AT89S52.
By the way, you REALLY need to do some in-depth digging on your parts if you want to use Multi-Master I2C. Manufacturers often gloss over whether a part uses Multi-Master I2C or not, and whether it does it in actual hardware, or merely in software.
@luiz you do not need to go anywhere. the player is supposed to appear above. if it does not please try the archive version which will also be posted here after the live event.
@FrankBishop I used 9600 bits/s a lot with the 8051, but I'm sure I have already seen a Freescale MCP communicating at 11kbits/s. This have to be agreed between master and slave.
jruddy- I'll ask jon that later but will also point you to our Advanced Microcontrollers track beginning Jan 30 where we have an entire session devoted to RTOSes.
If you are unable to hear please refresh the page. If that doesn't work try a different web browser. It's also possible your company's firewall blocks this.
If you are not hearing anything it is possible that your firewall is blocking the sound. This will be archived so you can listen outisde of your work place.
I guess I'm watching the archived version. The audio is blocked by my office's firewall, and since it's Flash, I can't listen to it on my iPhone. So much for that lunch hour idea.
@dmafackler that would be a great idea. This would help everyone who is not used to the american standard timing (like myself). For the time being, this might be handy: http://www.timeanddate.com/worldclock/converter.html.
You can dowload slides above where it says 'Today's Slide Deck'. At 2 pm ET the radio player will automatically show up and you will be able to listen to the presentation and follow along with the slides posted above. You can also ask questions to the lecturer by typing them below. All sessions will also be archived here if you are unavailable to listen at this time.
The streaming audio player will appear on this web page when the show starts at 2pm eastern today. Note however that some companies block live audio streams.
What is the format for this lecture? Video? Slides/live chat? The network at my work location is locked down very well when it comes to streaming media.
The seminar will not focus on one MCU, although some of the tips and tricks in Session 5 use the Microchip PIC MCUs as examples. Most of these tips can apply to other MCUs, too. --Jon
New versions of BASF's Ecovio line are both compostable and designed for either injection molding or thermoforming. These combinations are becoming more common for the single-use bioplastics used in food service and food packaging applications, but are still not widely available.
Andrew Morris designed a circuit that could detect a stroke victim's groan and convert the sound into a signal so caregivers would know when help was needed.
New disc magnet motors fit into the design trend of stepping up to closed loop performance while maintaining the cost advantage of stepper motor technology.
At the Design News webinar on June 27, learn all about aluminum extrusion: designing the right shape so it costs the least, is simplest to manufacture, and best fits the application's structural requirements.
On April 21, NASA launched a novel project, putting into orbit three satellites that employ an off-the-shelf commercial smartphone as the control system.
From Dell / Intel® New Paradigms in Design Work Scott Hamilton, vertical market strategist for Dell Precision workstations, 5/2/2013 5
Early in my career, I worked as a draftsman and remember the days of drawing on vellum with numbered pencils and Mylar with plastic lead. This was a fun experience in the sense that I ...
I've been using workstations for more than 10 years and love finding ways to get more performance from my system. With demanding professional applications that require more power each ...
A lasting memory from my first job as an engineer in an auto assembly plant is standing on hard concrete at six in the morning, vending-machine coffee clutched in hand, listening to ...
For industrial control applications, or even a simple assembly line, that machine can go almost 24/7 without a break. But what happens when the task is a little more complex? That’s where the “smart” machine would come in. The smart machine is one that has some simple (or complex in some cases) processing capability to be able to adapt to changing conditions. Such machines are suited for a host of applications, including automotive, aerospace, defense, medical, computers and electronics, telecommunications, consumer goods, and so on. This radio show will show what’s possible with smart machines, and what tradeoffs need to be made to implement such a solution.
To save this item to your list of favorite Design News content so you can find it later in your Profile page, click the "Save It" button next to the item.
If you found this interesting or useful, please use the links to the services below to share it with other readers. You will need a free account with each service to share an item via that service.