Questions tagged [microcontroller]

This tag is related to questions that have something to do with a microcontroller. A microcontroller is a simple or small processor often with its program and execution memory on the same chip with input/output pins for controlling other hardware. Please specify the microcontroller and compiler or tools related to your question.

This tag is related to questions that have something to do with microcontrollers in general. A microcontroller is a simple or small processor often with its program and execution memory on the same chip with input/output pins for controlling other hardware. Microcontroller programs are embedded programs often talking directly to hardware registers without using an operating system. Microcontrollers are generally resource limited, program space measured in bytes, kilobytes or megabytes, processor clock speeds often in the kHz and tens of MHz range.

3656 questions
1
vote
2 answers

Pic Microcontroller - how to calculate time between 2 events?

I have to measure the time between 2 events (pressing buttons), like this: if button1 is pressed -> start the timer if button2 is pressed -> stop the timer print the time (in milliseconds) between the events i am using the CCS Compiler and the…
da_Alex
  • 68
  • 2
  • 7
1
vote
1 answer

Is the second parameter in ioremap() gives the size in number of bits for a register- Linux?

My NEC microcontroller has a timer controller register 8-bits - Do, I need to pass 8 in the second parameter of ioremap? After reading the spec, I got to know the following property of it. Address |Function Register Name |Symbol |R/W…
1
vote
2 answers

ERROR 65 in ARM KEIL 5 (Permissions error)

I'm relatively new in ARM Cortex M4 series micro-controller. When I'm trying to debug a simple project(blinky which easily just blinks a led on and off) using KEIL 5 simulator, I get an error like this: * error 65: access violation at 0x400FE608 :…
Mohammed Noureldin
  • 14,913
  • 17
  • 70
  • 99
1
vote
4 answers

Redirect printf to Console I/O on IAR Embedded Workbench

I have coded a project of mine in C on a Windows machine in the software IAR Embedded Workbench IDE. The project compiles and runs fine. I have a couple of printf functions in my code. But the thing is that the project is intended for a…
Adam
  • 2,384
  • 7
  • 29
  • 66
1
vote
2 answers

Accelerometer Event Detection on STM32

I need to detect an accelerometer event when user hits the device on table/floor. Device is having a STM32 low-power microcontroller at 8 MHz and an LIS3DH accelerometer. The accelerometer is operating in +- 2G range. Sample numbers are signed…
Amit
  • 33
  • 4
1
vote
2 answers

Pic to Pic communcation through SPI

I am trying to make PIC1 be a master and PIC2 be a slave through SPI communication. I want to send a command from PIC1 (master) to PIC2 (slave), then have it do something. However I want to establish another SPI communication from PIC2 (slave) to a…
Ammar
  • 1,203
  • 5
  • 27
  • 64
1
vote
3 answers

copying data from array to vector c++ c99

i have 2 classes working with communication data in one class the array information is stored as a fixed array uint8 msg[512]; //fixed array to reduce mem fragmentation on target i want to memory copy this to a vector in the 2nd class…
1
vote
1 answer

How can I access to external memory as heap

I am working on embedded project with Keil MDK-ARM compiler. I try to access to external memory as heap but when I download my program in my micro (micro is a lpc1788) after the download is done it crashed (without start main function) in startup.c…
aria nikan
  • 11
  • 1
  • 4
1
vote
4 answers

Rock solid timer interrupt handling

I need to execute a procedure at constant time intervals. The procedure takes a long to execute and during that time other interrupt must be active. Also, it is critical that the procedure is executed at each timer overflow. Take a look at this…
maniek765
  • 37
  • 6
1
vote
2 answers

C++ timeout function

I want to realize a timeout function in C++ on a Atmel evaluation kit. The program should open the function "start()" and if this function is not completed within "0.5s" it should be killed. Are there any existing function to do jobs like…
matl
  • 135
  • 1
  • 3
  • 12
1
vote
1 answer

send data to ttyACM0 device

I'm trying to implement a function that whenever my ttyACM0 device receives a "hello\r", the LED will blink once. It blinks by using the command: echo -e "hello\r" > /dev/ttyACM0 And here's my question: does this command only write "hello\r" to…
Shan
  • 323
  • 2
  • 6
  • 12
1
vote
3 answers

How to execute large code in less ram?

I have a doubt that , in all micro controllers the flash memory much more that ram( Example: atmega16 it is 16k, However the RAM is just 1 Kb). . So , how exactly that code is executed , does the CPU execute directly from the Flash itself , if yes…
Virendra Kumar
  • 947
  • 2
  • 13
  • 31
1
vote
1 answer

Accessing an array of typedef struct

Hi guys I am working on Microchip based PIC32MX example for Printer host wherein i came accross following code wherin in the program to find out client driver to be used the following if loop is used.I am unable to understand the execution of the…
Deepworks
  • 371
  • 2
  • 4
  • 13
1
vote
1 answer

Decode and send a VGA video stream using AVR

I'm planning to use a AVR microcontroller, (ATMEGA32) to read a vga video signal, then send this signal to pc using usb. Is it possible to decode and send VGA signal with AVR ? My question is, Is the processing capability of avr is enough to decode…
Sarim
  • 3,124
  • 2
  • 20
  • 20
1
vote
2 answers

copy Array to Member of Struct in C

I'm trying to transmit data wireless. My payload-struct looks like this: typedef struct { uint8_t data[3]; } data_t I also have an array in my code: uint8_t data_to_be_copied[3]; if I try to simply assign each other I get the following…
Jan
  • 1,827
  • 2
  • 16
  • 29
1 2 3
99
100