How do I write to a pin on a Microcontroller? [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
In our school project, we have to write a code for a "soft start" to our miniature elevator. I'm supposing what they mean is that we should use the POWER-UP-timer so that the voltage levels stabilize after a restart. So in the block diagram, it seemed to be connected to VDD and VSS, which is ports 5 and 14. How do I write the code? Is there something I'm forgetting?
I don't really know where to start.

Soft start is where the motor starts slowly and gradually increases speed.
This is very useful especially in high-speed elevators as it keeps the passengers alive and happy.
If it's a brush motor use PWM. If it's a stepper vary the step rate and maybe use microstepping. if it's an induction motor your task is to build a VFD, good luck!

Related

C - Linux create sound in kernel mode [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I need o write a kernel mode driver that plays a note when a key is pressed. I can capture keystrokes but I have no idea how to play sound from kernel. What do I have to do to play a sound? I am brand new to creating drivers.
I need o write a kernel mode driver that plays a note when a key is pressed.
Why?
Seriously, why. What's the reasoning behind this "need"? What's the true reason for the need to play a sound? Maybe there is a better way.
Assuming a PC, with the pcspkr module loaded, you can of course call its functions. But if you want to play something through the soundcard, you'll essentially have to "open" an ALSA device (inside the kernel), and call its fops, all along while user space may do the same thing.

Can a Microcontroller peripheral operate with a frequency higher than CPU Freq.? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I wonder if a Microcontroller peripheral can operate with a frequency higher than CPU Freq. Is that possible?
It is entirely part specific - refer to the part's data sheet to reference manual.
For simple parts such as AVR, probably not (although I have not checked - there are many parts). For parts with complex clock trees such as STM32, certainly. For example:
In this example (calculated by ST's deprecated but still useful clock configuration tool), the core clock is 24MHz, while the USB is necessarily run at 48MHz and the I2S at 106.5 MHz. Note also that the I2S can be externally clocked independent of the HSE oscillator used in this example.

Redirect messages directed at the GPU [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Is there anything as low level as that on any Linux distribution? My overall goal is to redirect the message (instruction) meant for the GPU.
That means I would have to be able to program a driver between the CPU and the GPU which redirects any message to where I'd like (like a packet sniffer, but for GPU instructions and one that would stop the info there).
Is there any native Linux support for this kind of thing? Where do I start and what OS is most recommended for this kind of access?
You would need to modify the GPU driver. There you can insert logging or whatever other redirection you have in mind. Since many graphics drivers on Linux are open-source, this should be possible for many graphics cards. But take note that it won't be portable--you'll need to write some separate code for each major variant of GPU you want to support.
If you have something more specific, like that you're trying to capture OpenGL commands, that might make things easier.

How to write my own virtual machine like VirtualBox? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to write virtual machine. Ideally I want to write program, which will be run(emulate) windows 7(from .iso) and show it in window on Windows 7 parent. But I can't understand how to do it. I understand how to emulate cpu, for example, just write wrapper(interface) which will be provide real cpu resources(http://www.codeproject.com/Articles/43176/How-to-create-your-own-virtual-machine), but what next? how to run OS, which will be use this abstraction interface of cpu. Bios starts OS, should I emulate bios? how to do it? From what should I start? Please, describe me the basic steps to implement my task.
Thank you very much!
I'm sure years and years of work go into these type of programs. However, to get a taste of emulating CPU and coding it yourself, have a look at nand2tetris.
It starts by looking at the logic and arithmetic first, slowly working your way towards program control, high-level language and making a operating system.
Hope this helps!
(BTW it provides all materials and software for free!)

Controlling the toy car [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I wanted to control a toy car, that has two wires for voltage and two other wires for data in and data out.
I wanted to design, to control the car. The Idea is to control it with the mouse movement. If clicked the car has to start, if clicked twice the car has to stop and should move in left and right directions.
How can this be designed ?
In general, you will need a microcontroller attached to the car (e.g. Aurdino) and a communication mechanism between your computer and the microcontroller (e.g. Bluetooth or Wi-Fi).
You computer will send the command to the microcontroller which is wired to the car.
You can take a look at this Bluetooth Controlled Arduino RC Car to get an idea of how to start.

Resources