microcontroller

AVR or PIC? Using MATLAB

well, i have to use a microcontroller that will decide the further course of action of a robot,that is continuously capturing images,with an on board camera and using MATLAB to process those images.(in a competition).Which microcontroller should i go for? The AVR series or PIC?i know to use 8051 microcontroller, but now i have to interfa...

Concurrent access to struct member

I'm using 32-bit microcontroller (STR91x). I'm concurrently accessing (from ISR and main loop) struct member of type enum. Access is limited to writing to that enum field in the ISR and checking in the main loop. Enum's underlying type is not larger than integer (32-bit). I would like to make sure that I'm not missing anything and I can...

Microcontroller Serial Command Interpreter in C/C++; Ways to do it;

I'd like to interpret a command string, recieved by a microcontroller (PIC16f877A if that makes any difference) via serial. The strings have a pretty simple and straight-foward formatting: $AABBCCDDEE (5 "blocks" of 2 chracters+'$' for 11 characters in total) where: $AA= the actual name of the command (could be letters, numbers, both; m...

Control a USB light via software

I have a little USB-powered light. I'd like to be able to turn it on and off with software. I'll be attaching it to a Linux computer. I have an Atmel ATtiny2313 from a previous project, but I'd rather do this with a simple hack than repurpose my microcontroller. Is this possible? I suspect this can't be done as the computer won't talk t...

How does TickGetDiv256() works?

Hi I wonder if anyone could give me an example how the TickGetDiv256(); function works. It came from Microchip in Tick.c Im trying to count for 2 houre's, if fullfilled an engine will be stopped. I could might use "threshold = tick + TICKS_PER_SECOND * 60;" function. But I dont know if it would be good to use it for this amount of time...

Best Microcontroller for .net ?

What is the Best Microcontroller for .net ? (best = popular, good value, has many I/0, able to get support) ...

Any tips for dealing with a very small stack?

I was wondering if any developers in the embedded space know of any interesting tricks to help lessen the pain of developing for microcontrollers with very limited stack space. I've recently been writing some firmware for 8-bit uCs (Microchip PIC18F family, 31 byte stack) and as a consequence I have had to flatten my programs and reduce...

Coding Dojo for embedded

I'm looking for informations about how to make a coding dojo for embedded. More especific with C Ansi and also with Assembly, if possible. ...

"CPU is not halted" and "No APB-AP found" error

When I use JTAG to load my C code to evaluation board, it loads successfully. However, when I executed my code from main(), I immediately got "CPU is not halted" error, followed by "No APB-AP found" error. I was able to load and executed the USB-related code before I got this error. I googled for it and use JTAG command "rx 0" to rese...

How to demo examples of embeded systems?

It seems that a lot of small business people have a need for some customized embedded systems, but don't really know too much about the possibilities and cannot quite envisage them. I had the same problem when trying to explain what Android could do; I was generally met with glazed eyes - and then I made a few demos. Somehow, being able...

NAND flash programming: granularity of writes?

Hello all, is someone in the kow about write accesses on nowadays large NAND flash chips? What is the minimal granularity for writes? I have a microcontroller flash here which requires at least 1 and at most 4 words (16-bit words that is) to be fed to the write statemachine at once. I think that the large (> 1 Gbit) flashes behave diffe...

How to start developing with microcontrollers?

I want to be able to build my own small electronic device that just has a few buttons, and stores each keypress inside a memory. I am a pretty experienced programmer but I have no idea where to start regarding hardware, or what to search for on google. Please give me any info that can help me out. ...

Moving data from memory to memory in micro controllers.

Why can't we move data directly from a memory location into another memory location. Pardon me if I am asking a dumb question, but I think this is a true situation, at least for the ones I've encountered (8085,8086 n 80386) I am not really looking for a solution for moving the data (like for eg, using movs n all), but actually the rea...

Converting to ASCII in C

Using a microcontroller (PIC18F4580), I need to collect data and send it to an SD card for later analysis. The data it collects will have values between 0 and 1023, or 0x0 and 0x3FF. So what I need to do is convert 1023 into a base 10 string of literal ASCII values (0x31, 0x30, 0x32, 0x33, ...). My problem is that the only way I can th...

How are divisions handled in the PIC18 ISA

Kind of an extension of http://stackoverflow.com/questions/3694100/converting-to-ascii-in-c , I was wondering exactly how divisions are handled on a PIC18X. If I perform a DIV operation, how many instructions does the compiler interpret that as? How many clock cycles will it take for the operation to complete? Is the number of clock cyc...

What is the difference between microprocessor and microcontroller?

One difference is microcontrollers are usually designed to perform a small set of specific functions whereas microprocessors are for huge, general functions. Anything else?? ...

How to monitor RS-232 PC port1 (i.e. COM1)?

I have a Microcontroller Development board that is connected to my PC via RS-232 DB-9 serial COM port (whatever one you want to call it). The Micro has built in monitor code that uses functions like printf() and putchar() to produce console output on the PC side monitoring application. I want to use this output functionality to transmi...

Connect to SQL Server from Microcontroller (Arduino or Fez with .Net Micro Framework)

I'm looking for examples, tutorials, or just "this+this+this should work" for reading from and writing to a SQL server (2008) from a microcontroller such as the Arduino board. I've also looked at (and will probably go with) devices with the .Net Micro Framework such as the Fez Cobra. The Micro Framework does not include ADO. I'm sure t...

USART transmit problems on a PIC

I'm trying to send data to an SD card from a PIC18f4580, but the PIC is not sending what it should be. related global variables: unsigned char TXBuffer[128]; //tx buffer unsigned char TXCurrentPos = 0x00; //tracks the next byte to be sent unsigned char TXEndPos = 0x00; //tracks where new data should be put into the array I am adding ...

How does file sysem information get stored in memory?

Computers recognize different file systems. My question is, where exactly does this information get stored in a memory device (the specific location if any). Or does it not get stored anywhere & rather an operating system tests the system (memory device) against a known set of file systems (like ext3, ntfs, etc) ? With reference to the ...