Related to 8051 Microcontroller Crystal Frqequency - frequency

I am studying the basics of the 8051 Microcontroller. Why use 11.059Mhz crystal frequency instead of 12Mhz in 8051?

Instead of using 11.0592MHZ in 8051, it is difficult to find a integer value to be loaded for TH1 for generating baudrate.

Related

Can you use DAQmx without an NI optical encoder?

Does DAQmx solely work with NI hardware or can it work with other brands of equipment? If it cannot how would I start to make a block diagram for an optical encoder that stores the position of a stepper motor? Sorry for the newbie question, thank you.
As #AndreTec mentioned, Arduino would be good solution if you have moderate speed motor. You can connect your encoder outputs to two interrupt pins.
However, I encourage you to use pure serial communication between Arduino and LabVIEW to avoid data loss since no LabVIEW addons deals with interrupt up to the best of my knowledge.

add instructions to 8051 architecture

As you all know, most of the 8051 emulation/simulation softwares emulate 8051 Processor architecture.
Is there any such tool, which can append some extra Instructions into the 8051 Processor architecture and do some simulations and debug the codes.
OR,
if there is any method of doing this, you can suggest, without one tool?
One possible solution - which is not an easy one - is to get the code of an open source emulator like this and modify the processor model and the assembler to know your extra instructions.
Before you start you should study the processor architecture to know if your modifications are valid or not.

Why should one learn register level programing for embedded systems, when options like Arduino IDE ,etc are available?

I have done projects using Arduino IDE.I have seen that many projects can be easily implemented using the IDE.Then, why should one learn register level programing? How important is it?
Can you do EVERYTHING with the Arduino library? If your project would need tight timing (for example to control a huge industrial apparatus), at the level of microsecond fractions, would Arduino still be a good choice? How about medical devices? How about performance - would you be able to design a BLDC controller using Vector Control in Arduino? How about battery life - would you be able to design a device that would run with a single CR2032 cell for a few years using Arduino? How about doing a network router? Does Arduino support threads?
Your question is like one of these:
who needs x-bit microcontrollers when we have y-bit microcontrollers at the same price?
who needs x programming language when we have y programming language?
who needs analog solutions when we have digital solutions?
who needs microcontrollers when we have microprocessors?
...
To be honest, personally (I write firmware for embedded devices),I see Arduino as a toy, nothing more.
Learning register level programming will help you learning how to read a datasheet, and also understanding how stuff works. It will give you more flexibility after you get the hang of it, plus you can optimize your code and write your own libraries.
By knowing how to read a datasheet it will be easier for you to develop device drivers and process algorithms.
What would you do if you cannot find an Arduino library for a certain sensor? If you were using register level programming, you could easily write your driver, by already knowing how to interpret the technical files ;).
Try it out, you will forget Arduino in the first weeks!
Best regards,
Alex Tofan

FPGA input into Simulink

I have a DE2i-150 board. I currently have a Simulink model that introduces a sinusoidal input into an external control system. Rather than using the Simulink library for my input how would I use the board instead. I.E. I'd like to output data from the FPGA board which acts as the sinusoidal generator. The board can output data through USB,data, or serial ports. To clarify, the sinusoidal input I'm talking about is merely a Simulink block. Therefore, theoretically I think I should be able to examine the C program that Simulink creates and know which data to output from my board. Would I need to have Quartus running at the same time? Any ideas or advice would be greatly appreciated.
I didn't quite understand what you want to do exactly, but here are some ideas that you could start looking up:
writing your own S-Functions to call an external API that accesses your FPGA and generating C with Simulink Coder or Embedded Coder
writing Custom Storage Classes to call an external API and generating C with Embedded Coder
converting your model to fixed-point and generating VHDL with HDL Coder.

What microcontroller (and other components) would I need to create a timer device?

As a hobby project to keep myself out of trouble, I'd like to build a little programmer timer device. It will basically accept a program which is a list of times and then count down from each time.
I'd like to use a C or Java micro controller. I have used BASIC in the past to make a little autonomous robot, so this time around I'd like something different.
What micro controller and display would you recommend? I am looking to keep it simple, so the program would be loaded into memory via computer (serial is ok, but USB would make it easier)
Just use a PIC like 16F84 or 16F877 for this. It is more than enough.
As LCD use a 16 x 2 LCD. It is easy to use + will give a nice look to your project.
LCD
The language is not a matter. You can use PIC C, Micro C or any thing you like. The LCD's interface is really easy to drive.
As other components you will just need the crystal and 2 capacitors as oscillator + pull up resister. The rest of the components depend on the input method that you are going to use to set the times.
If you are using a computer to load the list then you will need additional circuit to change the protocols. Use MAX 232 to do that. If you want to use USB, you need to go ahead and use a PIC with USB support. (18F series)
(source: sodoityourself.com)
This is a set of nice tutorials you can use. You can purchase the products from them as well. I purchased once from them.
I would go with the msp430. An ez430 is $20 and you can get them at digikey or from ti directly, then sets of 3 microcontroller boards for $10 after that. llvm and gcc (and binutils) compiler support. Super simple to program, extremely small and extremely low power.
There are many ways to do this, and a number of people have already given pretty good suggestions AVR or PIC are good starting points for a microcontroller to work with that doesn't require too much in the way of complicated setup (hardware & software) or expense (these micros are very cheap). Honestly I'm somewhat surprised that nobody has mentioned Arduino here yet, which happens to have the advantage of being pretty easy to get started with, provides a USB connection (USB->Serial, really), and if you don't like the board that the ATMega MCU is plugged into, you can later plug it in wherever you might want it. Also, while the provided programming environment provides some high level tools to easily protype things you're still free to tweak the registers on the device and write any C code you might want to run on it.
As for an LCD display to use, I would recommend looking for anything that's either based on an HD44780 or emulates the behavior of one. These will typically use a set of parallel lines for talking to the display, but there are tons code examples for interfacing with these. In Arduino's case, you can find examples for this type of display, and many others, on the Arduino Playground here: http://www.arduino.cc/playground/Code/LCD
As far as a clock is concerned, you can use the built-in clock that many 8-bit micros these days provide, although they're not always ideal in terms of precision. You can find an example for Arduino on doing this sort of thing here: http://www.arduino.cc/playground/Code/DateTime. If you want something that might be a little more precise you can get a DS1307 (Arduino example: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1191209057/0).
I don't necessarily mean to ram you towards an Arduino, since there are a huge number of ways to do this sort of thing. Lately I've been working with 32-bit ARM micros (don't do that route first, much steeper learning curve, but they have many benefits) and I might use something in that ecosystem these days, but the Arduino is easy to recommend because it's relatively inexpensive, there's a large community of people out there using it, and chances are you can find a code example for at least part of what you're trying to do. When you need something that has more horsepower, configuration options, or RAM, there are options out there.
Here are a few places where you can find some neat hardware (Arduino-related and otherwise) for projects like the one you're describing:
SparkFun Electronics
Adafruit Industries
DigiKey (this is a general electronics supplier, they have a bit of everything)
There are certainly tons more, though :-)
I agree with the other answers about using a PIC.
The PIC16F family does have C compilers available, though it is not ideally suited for C code. If performance is an issue, the 18F family would be better.
Note also that some PICs have internal RC oscillators. These aren't as precise as external crystals, but if that doesn't matter, then it's one less component (or three with its capacitors) to put on your board.
Microchip's ICD PIC programmer (for downloading and debugging your PIC software) plugs into the PC's USB port, and connects to the microcontroller via an RJ-11 connector.
Separately, if you want the software on the microcontroller to send data to the PC (e.g. to print messages in HyperTerminal), you can use a USB to RS232/TTL converter. One end goes into your PC's USB socket, and appears as a normal serial port; the other comes out to 5 V or 3.3 V signals that can be connected directly to your processor's UART, with no level-shifting required.
We've used TTL-232R-3V3 from FDTI Chip, which works perfectly for this kind of application.
There are several ways to do this, and there is a lot of information on the net. If you are going to use micro controllers then you might need to invest in some programming equipment for them. This won't cost you much though.
Simplest way is to use the sinus wave from the power grid. In Europe the AC power has a frequency of 50Hz, and you can use that as the basis for your clock signal.
I've used Atmel's ATtiny and ATmega, which are great for programming simple and advanced projects. You can program it with C or Assembly, there are lots of great projects for it on the net, and the programmers available are very cheap.
Here is a project I found by Googling AVR 7 segment clock.
A second vote for PIC. Also, I recommend the magazine Circuit Cellar Ink. Some technical bookstores carry it, or you can subscribe: http://www.circellar.com/
PIC series will be good, since you are creating a timer, I recommend C or Assembly (Assembly is good), and use MPLAB as the development environment. You can check how accurate your timer with 'Stopwatch' in MPLAB. Also PIC16F877 has built in Hardware Serial Port. Also PIC16F628 has a built in Hardware serial port. But PIC16F877 has more ports. For more accurate timers, using higher frequency oscillators is recommended.