Questions tagged [microchip]

Questions related to the microchip PIC family of microcontrollers. Where possible please specify the specific microcontroller.

Questions related to the microchip PIC family of microcontrollers. Where possible please specify the specific microcontroller.

696 questions
-1
votes
1 answer

How to model devices?

I am looking for a way to create 3d model for a device I want to make from scratch, and be able to visualize its dimensions. I have tried using software like blender, but I don't think its the optimal way of doing this. What I want is to model, and…
invoidable
  • 21
  • 4
-1
votes
1 answer

Why does it give me the error "expected ')' before ';' token"

#define F_CPU 8000000UL #include #include #define testButton PINA & 0b00000001; #define smokeDetector (PINA & (1<<1)); #define ToggleSmoke (PORTE ^= (1<<4)); int main(void) { ADCSRA = 0b11100111; ADMUX = …
-1
votes
2 answers

Local const copy of global pointer for embedded C

I am a junior embedded software, and I spend most of my time writing C code for dspic33 microcontrollers. My embedded code is timer interrupts based, with a couple of global variables. Let's consider the simplest code possible: typedef struct…
panic
  • 2,004
  • 2
  • 17
  • 33
-1
votes
1 answer

How can add an offset to a pointer in C?

I'm modifying a microcontroller's firmware. I have two RxBuffers and I'm planning to add a third one so I'm planning to use the same routine to parse it all of them. The problem is that one of them has a different offset from the other…
E_Blue
  • 1,021
  • 1
  • 20
  • 45
-1
votes
1 answer

without while(1) why this code in MPLAB is running continuously

In this code I have not used while(1), only when it enters 'if' condition it calls TIMER_ISR function which has been initialised for every 250ms. But when it enters else condition there is no any timer function or anything but then also why it is…
Nancy
  • 1
  • 2
-1
votes
1 answer

PIC ports behaves randomly

I am trying for hours now to light up a simple LED on a button press with no luck. The pins seem to randomly get low and high for some reason. I am using MPLAB X IDE v5.54 and PIC12F1822. Can anyone spot my mistake? Here is the code: //…
Hasan Hasanov
  • 1,129
  • 2
  • 15
  • 23
-1
votes
1 answer

Header file inclusion doesn't work in MPLAB X IDE

screenshot of my code and error data This is my main.c file #include "services_initialisations_prototype.h" #include "services_functions_prototype.h" void main(void) { initSfr(); while(1){ updateMatrix(404, 1); } …
jauhar_k
  • 73
  • 2
  • 6
-1
votes
1 answer

Microchip PIC 12F617; calculating delay using TMR2

I familiarising myself with MPLAB X IDE and staring development with C using a Microchip PIC 12F617. I have a simple program (copied from elsewhere) to flash a LED: on for 1 second then off for 1 second. It all works but I my calculation of the…
-1
votes
1 answer

How to write a hex string over UART for PIC Microcontrollers in C?

I'm having trouble writing a hex string for UART. I can send a single byte, for example: UART2_Write(0x80); I'm now needing to do a full hex string so something like the following: UART2_Write(0x80, 0x70, 0xAD, etc) Can anyone help? Do I need to…
Finners
  • 37
  • 7
-1
votes
1 answer

Questions about displaying 0x00 to 0xFF with two seven segment Lights

Can someone please help me with this? I have been researching and trying to get this working, but I'm out of luck. All the codes I found online were not working... The output, for now, is 00, 11, 22, 33, ... FF and lop back to 00. How do I separate…
-1
votes
1 answer

mplabx ide v5.10 version configuration failed... How can I regulate?

I take these errors when making clean and build or debug **`list P=18F45K22, r=dec, n=0 #include ; /* setup to use the 4xPLL with a 16MHz internal oscillator for a 64MHz system clock */ config FOSC = INTIO67 ;/* Internal…
-1
votes
1 answer

How to auto pair my BLE Peripheral on my device?

We are developing an application which needs the BLE Peripheral to be automatically paired with the smartphone when the smartphone is near the BLE Peripheral. We are using RN4871 Microchip BLE Board, First time when I pair the device from the…
md.jamal
  • 4,067
  • 8
  • 45
  • 108
-1
votes
3 answers

PicKit3 and PIC16F1829 programming, MCLR voltage

I just started with microchip world. I'm about to buy a PicKit3 and i've seen it can outputs from 1.8V to 14V MCLR. The pic i will use is the PIC16F1829 and it should work with MCLR @ 5V. In the datasheet it seems i would need a zener/shunt to limit…
user217354
  • 145
  • 1
  • 14
-1
votes
1 answer

How to make this for loop both dim and brighten the LED?

I have a for loop made by my teacher that dims (or brightens) an LED connected to a PIC18F2455. I have to make the code do both, first brighten, then dim it, but my C skills aren't good enough for this. How can I make this happen? int…
Underi
  • 1
  • 1
-1
votes
2 answers

IF condition with binary argument

Sorry to ask again... But I seem to struggle with binary... I stumbled upon the following line MGC_SSPBUF_REG = (GESTIC_I2C_ADDR << 1) | 1; // write Address to MGC3130 Beside the fact, that don`t know, why one would shift the address to the left…
user3554329
  • 111
  • 2
  • 11