Questions tagged [pic]

PIC is a family of Harvard architecture microcontrollers made by Microchip Technology.

PIC is a family of modified Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller". wikipedia


For questions regarding Position-Independent Code, use instead.

1624 questions
4
votes
1 answer

Securely transmit commands between PIC microcontrollers using nRF24L01 module

I have created a small wireless network using a few PIC microcontrollers and nRF24L01 wireless RF modules. One of the PICs is PIC18F46K22 and it is used as the main controller which sends commands to all other PICs. All other (slave)…
user2686599
  • 41
  • 1
  • 2
4
votes
1 answer

How to make data bank size more than 256 bytes [Linker File - MPLAB ]

I have PIC18F87J11 FAMILY and I am using MPLAB C18 Compiler. What is the maximum bytes I can give the following variable. I know that I have to modify the linker file to achive more than 256 bytes. #pragma udata CONNECTION_TABLE This is my clean…
cookie monster
  • 77
  • 1
  • 10
4
votes
3 answers

Converting PIC Assembly Instruction to machine code

I've seen there are specific formats to convert MIPS assembly instruction to machine code. There should be similar procedure to convert PIC assembly to machine code manually. Can anyone kindly provide me the documentation related to this?
Rifat Rousseau
  • 289
  • 1
  • 4
  • 16
4
votes
4 answers

Double slash comment substituition within a macro

I am developing a PIC MCU program on an ansi-compliant compiler (Microchip XC8). There are two operation modes, determined via macros during compilation time. So that I don't want to duplicate one function-like macro due to one line of code, I would…
4
votes
2 answers

FTP Client for PIC microcontroller

Does anyone know of a Source Code for a FTP Client that I can use with a PIC microcontroller? Preferably in C and I am using a PIC 18F97J60. It is ok even if the source is for a different PIC, I can modify it to support my need. Thanks.
Bathiya Priyadarshana
  • 1,325
  • 6
  • 22
  • 35
4
votes
5 answers

PIC Microcontroller Operating System

I heard it is possible to write an Operating System, using the built in bootloader and a kernel that you write, for the PIC microcontroller. I also heard it has to be a RTOS. Is this true? Can you actually make an operating system kernel (using…
Coder404
  • 742
  • 2
  • 7
  • 21
4
votes
2 answers

PIC32 SPI ISR not being called when RXIF flag set?

I'm using a PIC32MX795F512L SPI3 module in slave mode. My master is sending data over the SPI line but my slave's interrupt service routine is never being called. The RX interrupt flag is being set in hardware on the slave side and I can read the…
CodeFusionMobile
  • 14,812
  • 25
  • 102
  • 140
3
votes
5 answers

why choose one's complement when writing to a register

What are the benefits of, for example writing the first statement vs second statement: First statement: ANCON1 = ~0x0C; Second statement: ANCON1 = 0xF3; I'm seeing the second as a clear choice I would have made, cause it's more straight forward…
Christian
  • 1,548
  • 2
  • 15
  • 26
3
votes
4 answers

How to make a !default case in C

On a micro-controller program I have a few instructions that I would like to execute for every case in a switch except the default. I do not, however, want to write a function call or use a macro for every case. Because this is for a…
Jeremy
  • 103
  • 12
3
votes
6 answers

integer overflow in a PIC -- where's the flow go?

Working with a Microchip 18f4620 PIC. This should be a standard ANSI C question, though. Say I have unsigned int16 badFlow=65535 //max unsigned int16 value This has a binary value of 1111 1111 1111 1111. if I then badFlow++; the bit pattern…
Sheriff
  • 495
  • 4
  • 16
3
votes
5 answers

Increasing performance of 32bit math on 16bit processor

I am working on some firmware for an embedded device that uses a 16 bit PIC operating at 40 MIPS and programming in C. The system will control the position of two stepper motors and maintain the step position of each motor at all times. The max…
PICyourBrain
  • 9,976
  • 26
  • 91
  • 136
3
votes
1 answer

unknown Opcode '.pword'

When I compile my code I am getting a unknown Opcode '.pword' error. The only line of code in my project that has .pword is: do { __asm__ volatile (" .pword 0xDA4000"); Nop(); } while(0) Commenting the line out does nothing. I searched…
microb
  • 93
  • 1
  • 2
  • 9
3
votes
1 answer

Creating an ASM file that will return the characters located in 8 consecutive registers

I have to create an ASM file for the PIC18F452 that does the following: (a) define the label MapName as the first of 8 consecutive registers containing a null-terminated string of not more than 7 characters. (b) access an 8-bit unsigned integer…
D Brown
  • 460
  • 3
  • 8
  • 22
3
votes
2 answers

PIC 16F84 PCLATH Bit3+4 unnecessary for CALL/GOTO?

I am trying to simulate the PIC16F84 and now need to implement PCL / PCLATH registers. The PIC16F84 has 1K of Program memory. The PCL is 8Bit wide, so in this case Bit 0 and 1 of PCLATH is used to switch between the four Pages each having a size of…
3
votes
1 answer

Why doesn't my program recognize the PORTbits.RCx == 0 condition?

void UART_init(void){ ANSELB = 0; //set PORT B to digital port TRISBbits.TRISB5 = 1; //set RX pin to input TRISBbits.TRISB7 = 0; //set TX pin as output SPBRGH = 0; SPBRGL = 25; //set baud rate to 9600 BRGH =…