Click here to Skip to main content
15,881,898 members
Everything / Microcontroller

Microcontroller

microcontroller

Great Reads

by Sacha Barber
A look at an excellent WinRT MVVM framework.
by jurhas
A small simulator for a 6 axis articulated robot
by Mike Hankey
Part 2 in an on going series of article featuring an Autonomus Rover
by GProssliner
cobj is a preprocessor based generator for interface based polymorphism

Latest Articles

by Richard Chambers
An introduction and a first walkthrough of using STM32CubeIDE with the ST32F3DISCOVERY board.
by André Marcos (Advisor), Gabriel Trepak, Vinícius Barauna Santana
Automating the Residential Lighting Activation Process Using Arduino
by Haily Swift
This article shows how to collect analog signal through the ADC module.
by Jan Dolinay
This article shows how to set up VS Code to debug your Arduino program.

All Articles

Sort by Score

Microcontroller 

4 Nov 2013 by Sacha Barber
A look at an excellent WinRT MVVM framework.
19 Jan 2014 by Mike Hankey
Part 2 in an on going series of article featuring an Autonomus Rover
7 Jun 2016 by GProssliner
cobj is a preprocessor based generator for interface based polymorphism
6 Jun 2016 by Alexandr Surkov
How to build and run .Net Micro Framework 4.4 on STM32F4Discovery board.
29 Feb 2016 by Alexandr Surkov
My experience of using C++ with microcontrollers
4 Sep 2017 by Chris Boss
BASIC is one of the most misunderstood programming languages! Mention BASIC to a current software developer and one quickly finds out that it is not viewed favorably by most programmers.
13 Feb 2012 by Mike Hankey
A Real Time Clock development board.
14 Oct 2021 by Richard Chambers
An introduction and a first walkthrough of using STM32CubeIDE with the ST32F3DISCOVERY board.
1 May 2015 by Intel
As one of the interfaces on mobile devices and tablets, the key function of the audio jack is to play music. However, its other usage cannot be ignored—the audio jack can also be used to transmit data.
21 Jun 2016 by Dharmateja Challa
Tip on how to simulate external interrupts using Atmel Studio 7 for AVR Atmega MCUs
8 Oct 2019 by Rick York
A few things are notable to me. 1: You do not initialize the value of recv. It probably should be set to 0 to be certain it enters your while loop at least once. 2: Your array buffer arr is of size 10 but you could potentially receive more than ten characters because the loop doesn't care how...
28 Mar 2014 by jurhas
Spada via Modbs, Supervisory Control and Data Acquisition with visualb basic,Arduino and firebird
9 Nov 2014 by charankumar516
Absolute Beginner's Guide to Arduino
21 Oct 2016 by marcus obrien
Computer engineering and the hidden neural network brain in the Arduino 101
8 Oct 2012 by Richard MacCutchan
Fine, go and look for it, but do not expect anyone here to do your final project for you.
19 Nov 2012 by Ed Nutting
Hi there,Same as my comment but as suggested, now posted as a solution (so that this stops showing as an "Unanswered question":"PORTD OrEquals 1 left shifted the number of times of the value of PORTD1" i.e. PORTD = PORTD | (1
27 Oct 2015 by Patrice T
Quote:I am expecting the result data of C# application like the result from Matlab and XCTU. I have tried with SerialPort encodings(ASCIIEncoding, Unicode, Latin). But nothing works. Help me. this is my code,The trick is simple, you receive binary data from serial port, don't convert it.Your...
6 Nov 2018 by CPallini
You should declare your variable extern in the header and define it in the source file (without the static keywork: static in source file provides internal linkage). See, for instance: Internal linkage with static keyword in C - Stack Overflow[^].
6 Nov 2018 by Richard MacCutchan
You should not be defining them in the header file if they are static, just in the .cpp file. If you are trying to create global variables then you should declare them extern in the header, and give them a value in one .cpp file only, like: // header.h extern int variable; extern int...
18 Mar 2010 by Avi Berger
You seem to be responding to this article[^]. You should post you questions about an article in the forum at the bottom of that article.As far as your question goes, each bit in the register refers to a port pin. Which pin and what a value of the bit for that pin represents is something you...
18 Mar 2010 by Richard MacCutchan
bhai_kaju wrote:The only thing I am confused with is ...... I did not notice the forum at the end of the article where questions or comments should be posted.
9 Apr 2012 by OriginalGriff
Assuming this is a 9 pin connector, don't worry too much about 1 and 9 - they are DCD and RI respectively so you probably don't need them.Just try connecting 2->3, 7->8 and 4->6 and see if it works. (5 is ground, and you shouldn't need it for null modem since it doesn't go anywhere)
20 Nov 2012 by OriginalGriff
Depends on the microcontroller, and on how the data has been written to it.Some have a security bit which when set corrupts some or all of the data when it is transferred out of the device (PIC devices do this -they are called the Code Protection Bits[^]) You explicitly set these bits once...
2 May 2014 by OriginalGriff
Firstly, stop opening and closing the port: it won't help and it may cause data to be lost. While the port is closed, anything received by the physical port will be thrown away...and it allows other applications to "grab" the port as well. And you don't need an event handler to pass the data...
10 Nov 2014 by Prilvesh K
Getting started with Spark Core,setup a guide for everyone new.
26 Nov 2015 by Jochen Arndt
It seems that you don't want to use an enum but a structure:typedef struct{ unsigned hb; unsigned mb; unsigned lb;}BunchOBytes;
19 Mar 2010 by Avi Berger
bhai_kaju wrote:I couldn't find any kind of port number assignment or HEX equivalent. So, how do I know what to write in the code, and if anyone could tell me the meaning of this code :" #byte port_b=6 // IC =16c84 "why port_b = 6, not 4 or 5 or anything else.bhai_kaju also...
18 Mar 2010 by DaveyM69
In a PIC uC, TRISX means Tristate-Port.When a TRIS bit is set to 0 it's port pin is set to be an output, when 1 it is set to be an input.So if you have for example portB which has pins RB0:RB7 you can set the individual pins as inputs or outputs by either writing a complete value to the...
14 Apr 2010 by LittleYellowBird
Hi,You are really on the wrong forum here. Microchip (who manufacture the chip) have their own forum which is actually quite good. Here's the link ....[^]You will need to refer to the data sheet for specific of how to setup the chip and the Hitech compiler help for information on...
12 Apr 2010 by OriginalGriff
Why are you using a 877? It is listed as "Not Recommended For New Design" on the PIC website, which means that they are likely to stop manufacturing it in the near future, if they haven't already. Certainly, it is no longer listed as "in production", and I would be very nervous about the...
2 Dec 2021 by limwy
Hi...I have a problem with c programming for pic32 microcontroller. i have problem programming for I2C using PIC32. i need to program I2C to communicate with ADC chip AD9883A. I can write to the chip in sending a byte. But i have problem sending in multiple byte.This is my codes.. i hope someone...
28 Apr 2010 by OriginalGriff
Not tried I2C myself, but Microchip have a good software library of code examples: I2C examples here[^]It is always worth checking the Microchip site first, as this question is a bit specialist for a general programming site.
29 Apr 2010 by Jonathan Davies
Does the break after your test of limwy wrote:if( I2C1STATbits.ACKSTAT ) take you out of the while loop after the first Ack is recieved?Multibyte transmission after sending the adress and receiving an Ack should be to send 8 bits and wait for an Ack on the 9th clock pulse then either send...
29 Apr 2010 by LittleYellowBird
Hi,I have had a quick look at your code and I think you need to tidy it up a bit - there a few inconsitencies. If you do that it will be alot easier to follow.For example, unsigned char i2cData[4] = {0x98,0x01,0xAA};This array has 4 elements, but only 3 are loaded, then it is...
11 Jun 2010 by Henry Minute
Have you searched/asked in the MatLab forums. You are far more likely to get suitable answers there than here.
23 Jun 2010 by Sauro Viti
Look at Ch -- an embeddable C/C++ interpreter[^]: as stand-alone interpreter they have a free of charge version.Anyway you added the tag Microcontroller to your post... In such a scenario a compiler is too much better, both for speed and resource required.
19 Oct 2010 by JF2015
Hi,to communicate with the AVR, you will need the AtUsbHid.dll provided by Atmel. You should contact them or try to get the dll from their website. I'm pretty sure they also have some examples (at least for basic stuff as connecting to the controller)
27 Oct 2010 by Ankur\m/
Well, I have no idea about the project you are working on, but I can help you with AT Commands and sending receiving SMS part.Introduction to AT Commands[^]Read the whole tutorial from the above site. It explains AT commands and it's use in sending and receiving SMS very well.This...
16 Apr 2011 by OriginalGriff
First thing to do:Open HyperTerminal (or similar) set up the com port, the baud rate, bpc and stop bits.Try to talk to your microcontroler using the keyboard. If that works, then move on to step two. If it doesn't work, then find out why first. It may be control lines (RTS/CTS etc.) it may...
6 Feb 2012 by OriginalGriff
I tell you what - you tell me what I should do to fix my car, and I'll tell you.But you can't - you don't know what's wrong with it, what the symptoms are, or even if I have a car.So why ask us a similar question?We can't answer that as is, apart for suggesting that you wire it...
9 Apr 2012 by OriginalGriff
There is no way we can really help you with that question.We have no idea what hardware you have available, or your ability level.However, it is clear that you have no idea how complex any of this is. So, assuming you have an LCD attached to your uController here is a challenge for you:...
19 Nov 2012 by CPallini
OK, that makes sense provided PORTD1 = 1;You should be able to find #define PORTD1 1 in one of the included header files (I suppose in avr/pinports.h).This way (as Ed already showed)PORTD |= (1
2 Dec 2012 by Sergey Alexandrovich Kryukov
You need to develop some application-level protocol with some "Restart" command. As you need to do the restart on PC restart/shutdown, you can do this by using the class Microsoft.Win32.SystemEvents. You will need to handle the event SessionEnding or...
27 Mar 2013 by Sergey Alexandrovich Kryukov
You need to know that BeginInvoke is the member of System.Windows.Forms.Control or System.Windows.Threading.Dispatcher:http://msdn.microsoft.com/en-us/library/system.windows.forms.control.aspx[^],http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.aspx[^] (WPF).On...
30 Mar 2013 by Dave Kreskowiak
First, you've got no code in here that tells the borwser to not cache the page and to refresh it every so often.Second, your code will only fill one textbox, out of TextBox1 and TextBox2, and not the other, depending on the one character position you look at in the string. Just follow the...
7 Aug 2013 by Sergey Alexandrovich Kryukov
You can take the reference on the microcontroller, retrieve the duration of every commands involved, which is usually specified in processor's "ticks". Calculate the duration of the tick from the tact frequency used. Summarize all together.Another approach is to use real-time clock (it it is...
7 Aug 2013 by Ron Beyer
Sergey's answer is the best, I just wanted to add a couple notes that are longer than what would be placed in a comment...First, the crystal frequency does not really dictate processor clock cycle time, due to hardware multipliers and other factors. Processors can execute more than one clock...
16 Jan 2015 by Zoltán Zörgő
Ok, and what have you done to find any? You have really searched? How? This is the first google result: http://frz.ir/dl/tuts/8086_Assembly.pdf[^]Wha isn't this good enough?
3 Aug 2015 by Sergey Alexandrovich Kryukov
There is nothing special about microcontroller programming and nothing so special about C# programming. These days, C# is implemented for CLR and CLI, so it can be used everywhere where CLR and CLI are implemented. It's less likely for microcontrollers, because of this part of this word...
3 Aug 2015 by User 59241
Yes if they support .NET Micro Framework. http://www.netmf.com/[^] and: https://en.wikipedia.org/wiki/.NET_Micro_Framework[^]A widely used platform is Netduino: https://en.wikipedia.org/wiki/Netduino[^]Search Netduino in CP articles.
17 Feb 2016 by Jochen Arndt
A compiler generates relocatable object files which are then linked. While there might be an option for the C compiler (check the manual for your compiler), it is more probable that a fixed start address is passed to the linker or defined in some configuration file (probably a processor specific...
12 Mar 2016 by OriginalGriff
It's a standard #define - it means that the preprocessor will replace the text ADC1 with ((ADC_TypeDef *) ADC1_BASE)each time it sees it in your source code. Look up the definition of #define and you'll see what I mean:Preprocessor directives[^]
21 Mar 2016 by GaneshRfromSpace
I am a beginner to Embedded Systems. I am working on Freescale Kinetis E series controllers. I use Kinetis Design Studio IDE. I wrote a project to blink the LEDS in a customized board. Now I want to make it as a S19 file which I would load to my other project using Terminal Application. Is it...
20 Mar 2016 by Arthur V. Ratz
Here's how to create S19 files:S-Record Generation with gcc for ARM/Kinetis | MCU on Eclipse[^]andConverting S19 Files into Binary Files with GNU objcopy | MCU on Eclipse[^]
13 Apr 2016 by Member 11246861
Within LAN, laptop gets signals from microcomputer and microcontroller using TCP/IP and SPI
28 Sep 2017 by Jochen Arndt
Quote: - serial port number changes sometimes That might happen when plugging the USB-to-Serial converter into a different connector. But it should not happen when not unplugging the converter. Quote: - another application can "steal" the port and kill the communication COM ports are...
23 Apr 2019 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you. So we need you to do the...
1 Jun 2021 by Patrice T
Not your question, but: Advice: Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spotting structures mistakes. #if defined(__PCM__)#include #fuses HS, NOWDT, NOPROTECT,...
12 Jul 2021 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
12 Mar 2010 by limwy
hi there..i will like to ask if anyone have codes/program for me to study like display on the LCD or control the display throught the button or anything related to the board.. thanks so much...
18 Mar 2010 by bhai_kaju
I have the complete datasheet of the CHIP but I couldn't find any kind of port number assignment or HEX equivalent. So, how do I know what to write in the code, and if anyone could tell me the meaning of this code :" #byte port_b=6 // IC =16c84 " why port_b = 6, not 4 or 5 or anything...
18 Mar 2010 by bhai_kaju
Many many thanks to all of you who spared some time from you busy schedule to clarify my doubts. I am clear now and my concepts just got better upon reading the answers, hats off to you guys !! :thumbsup: :-DOne thing I found out in the memory organisation of PIC16C84 in relation to this...
20 Mar 2010 by bhai_kaju
Can anyone please tell me, how to take the output of the internal oscillator in PIC ICs to the output port so that I can view the waveform in an oscilloscope, using C language ( coz m using C compiler :-D )
18 Mar 2010 by bhai_kaju
Hello, I have read your program for the LED ON/OFF & found it to be pretty simple to understand. The only thing I am confused with is this command :" TRISB=0xF0; // RB4:RB7 are input ; 11110000 in binary "I want to know how did you find out that 0xF0 is the right value for the ports...
20 Mar 2010 by OriginalGriff
I don't think you can, normally, but even if you could it would depend on which of the (vast) PIC family you were using.Why would you want to anyway? Is it an R/C oscillator or a crystal? Because the chances are good that any probing on either will alter the output anyway![edit]Added...
19 Mar 2010 by DaveyM69
Yes, in that case it is referring to the actual address of the port as listed in the register file map in the datasheet[^] on page 12.Normally you wouldn't define this yourself but instead include the file for the device that Microchip provide (installed along with MPLAB IDE) as everything...
21 Mar 2010 by bhai_kaju
Its an R/C oscillator and the chip is PIC16F72. I just want to check the waveform in the oscilloscope for my own experimentation. :)
1 Apr 2010 by bhai_kaju
Hello, can anyone please tell me how to program a PIC16F72 chip to output a text like "HELLO" to a LCD DISPLAY. I am using CCS compiler to compile the code.here is a sample of my code :#include#USE DELAY(Clock=4000000)#FUSES XT,NOWDT,NOPROTECT#USE...
1 Apr 2010 by Richard MacCutchan
Take a look here[^], and you should be able to find the information you need.
1 Apr 2010 by bhai_kaju
Thanks for your help, but that wasn't of much help to me. Can someone please tell me how to communicate with the LCD like displaying a text. I am using the CCS Compiler and not HI-TECH C Compiler ..Thanks a lot in advance :-D
1 Apr 2010 by CPallini
It really depends on the hardware involved. There are a lot of different LCD displays around and you say nothing about the one you have to deal with.As a general rule, reading the documentation should help.BTW: please add further details to your original question, don't post fake answers. :)
9 Apr 2010 by limwy
Hi.Do anyone have a simple code for writing/reading and sending a page and not byte by byte, using periheral library?Thanks.
12 Apr 2010 by manaila
I am using PIC16F877 and HI-TECH C Compiler and I wish to include some delays in my code, but i do not know how to prescale the clock or how to set the iternal clock frequency of the PIC coz i wanna use the internal clock. I also dont know how to declare and use the PORTS and PORTS bits in C. I...
29 Apr 2010 by r.ps
limwy wrote:But i have problem sending in multiple byte.Would help if you can tell us what the problem exactly is.Also what does IdleI2C1 do? Most problems with i2c are caused by not handling all parts of the I2C specification(as someone else has already pointed out). For e.g. does the...
12 May 2010 by limwy
Hi I'm trying to combine two of my code to run together to calculate the frequency and number of line in HYSNC and VSYNC signal. I have got the VGA signal from a cpu and im using change notification to capture the VSYNC signal and timer/counter to capture or count the number of HSYNC lines in...
12 May 2010 by OriginalGriff
Micheal Godfroid is right in that you will probably get a better response from a more dedicated forum - there are PIC people here, but they are few and far between.In the mean time, I would start by checking inputs etc: Hook up a dual channel sig gen at a low frequency and check you catch...
15 May 2010 by Sandeep Mewara
Either go here:http://www.codeproject.com/script/Jobs/Edit.aspx[^]ORgo here:http://www.google.com/search?hl=en&complete=1&q=voice+comparator+C%23&aq=f&aqi=&aql=&oq=&gs_rfai=[^]Until unless you don't post your effort and specific issues, it's difficult you get more help than this.
9 Jun 2010 by Miljko
HI,I am a fourth year student of Electrical Engineering and currently doing my BSc work with the task to implement a 6LoWPAN[^] stack on TI cc2530.Whether we can help with the selection of a stack, advice about stack and implementation, or refer me to where I could find information that...
11 Jun 2010 by f_siddiqui
How can I take input from serial port of PC using Matlab? Can I do encoding and modulation in C? If yes then how? If I have a C program, can it be dumped by means of Keil into microcontroller 805?Thank you.
15 Jun 2010 by signal.processor@yahoo.com
Hi, U can mail me your project details @ signal.processor@yahoo.com I will let u know what can be done?Regards
22 Jun 2010 by siliconray
Hi,I am looking for free C/C++ interpreter. Is there one if you tested and you suggest it.
23 Jun 2010 by Sauruxum
see at this: http://codepad.org/[^]This suport many program languages and scriptsAnyway, a compiler is better.greetings
30 Jul 2010 by rawflewaffle
Hey everyoneI've been attempting to create a code-locked safe for a few days, and have come up with a schematic. The hardware is wrapping itself up, however I have hit a speed bump in my progress. I need help with the software. I am using a pic16f628a to drive a motor in two directions (open...
31 Jul 2010 by E.F. Nijboer
Well, thanks for the vote of 1 but I cannot help you if you have no idea of what you expect for an answer. In my opinion my answer fits exactly to your question.I am also a little shocked by your statement that as far as you understand there aren't if then statements in assembly. Well, do you...
20 Oct 2010 by cs101000
I am working on a windows forms application project. I have a serious problem in communicating with my avr microcontroller: at90usb1287. I have designed a form using vc# And according to the input from the user, am going to send data to eeprom of the avr micro. I want to send data into its...
19 Oct 2010 by Johnny J.
I very much doubt that anybody here has the knowledge to help you with that. Much better to contact the hardware manufacturers and get the information from them
19 Oct 2010 by LloydA111
Could you not simply use the programmer software to modify the EEPROM? Or do you specifically need to be able to modify it using the application your making in VS?If you do need to do it with your VS project, then there are two choices that I can think of. Either write some code for the AVR...
27 Oct 2010 by Be Yourself
I am totally new to these commands and am going to start a project which is as follows:I am going to work on a project that will turn on or off the electrical equipments in your home by sending "sms" from your personal cellphone to the home cellphone.For this I require two modems .One...
6 Jan 2011 by HimanshuJoshi
There are plenty. Search google for 8080 microprocessor programming books and you will find dozens. Take this[^] for e.g. They will even give you student discounts. Best of luck for your exams.
27 Jul 2011 by willworknow1
Can anyone tell me what is wrong with this HTTP POST packet? The web server seems to be ingoring it.Prior to URLEncoding and without Base64 encoded data:"POST /Default.aspx HTTP/1.1\r\nHost: www.host1.com\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length:...
27 Jul 2011 by mbue
The server should accept the "Prior to URLEncoding" snippet. Cause thats correct. You have to encode the post data only.Regards.
17 Aug 2011 by ali2012
can i implement a high pass FIR filter with 0.3hz transition band width on AVR micro?
14 Dec 2011 by OriginalGriff
Saying "it's not working" when you are dealing with embedded software isn't a lot of help. Or any, really.We can't see the LCD, we can't see your inputs, we don't know your circuit.I would start by testing the various sections:Clear the LCD, and put a specific pattern on it. Does that...
14 Dec 2011 by CPallini
You'll probably better ask at Microchip forums. Anyway it looks like you don't even switch ON the ADC (ADCON0 bit 0: ADON).BTW: I strongly doubt 'C++' is the appropriate TAG for your question.
14 Dec 2011 by Pranit Kothari
What are you talking about. This may help,How to ask a good question?[^]
14 Dec 2011 by eng saraz
may you delete this Qu plz ??i can not delete it ,, i do not want to get more answers ,until i specify the problem and write it again in la proper way thanks in previous
6 Feb 2012 by CPallini
Probably you meant: "how to measure, using a microcontroller, the AC analog input voltage and report it on a LCD display connected to the microcontroller itself?".Even posted this way the question is too broad, you have to be more specific (after all this is 'Quick' Answers) and detail your...