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
3
votes
1 answer

PIC16F1787 Internal Oscillator

How can I use the Internal Oscillator of the PIC16F1787 with 32MHz? The Datasheet says that you have to set the FOSC setting to 100: #pragma config FOSC = 100 It also says that you have to change someting in the OSCCON settings, but I dont know how…
3
votes
1 answer

Can "swap nybble" and "byte mask" tricks do multi byte logical shift by 4 much faster than the naive method of using bit shift chains

I'm writing a fixed-point (16Q16) algo that does division using the Newton–Raphson method outlined on Wikipedia. (Related SE question HERE.) The first step requires logical right-shift by anywhere from 1-16 bits. My CPU is an 8-bit microcontroller,…
Charlie
  • 258
  • 2
  • 9
3
votes
2 answers

Vector address starts in the middle of program memory

I'm using MPLabX IDE 5.4 with XC8 compiler (a C/MPASM hybrid compiler that has a driver named pic-as v.2.2 as its assembler) to compile/assemble a simple piece of assembly code and to output a listing file. My entire assembly code: PROCESSOR…
KMC
  • 19,548
  • 58
  • 164
  • 253
3
votes
5 answers

Micro-Controllers programming

I'm having this robotic arm project along with some engineers we haven't settled for the Micro Controller of choice yet but currently a PIC is being tested. I was wondering if there were Micros that support C++ ? Background: I'm a (Java) software…
Ismail Marmoush
  • 13,140
  • 25
  • 80
  • 114
3
votes
1 answer

Is this a safe way to disable interrupts on PIC24?

I am working on a project that uses a Microchip PIC24FJ256GA702. For several days I have been looking for an intermittent bug with some UART code. It uses an interrupt service routine (ISR) to transmit a buffer named char txBuff[] and its length int…
James
  • 5,635
  • 2
  • 33
  • 44
3
votes
3 answers

Forcing compiler to make arithmetic calculations during preprocess

Compiler: MPLABX IDE V5.30 Operating system: Windows 10 What i'm trying to do is define some constant values (to make future changes easier) and create some other constants via arithmetic operations during preprocessing. Then use those constants…
kudagaci
  • 33
  • 3
3
votes
1 answer

.inc File Not Included Reliably

I am working on some HTML code that was inherited from another programmer, which uses include statements of the form: ~inc:filename.inc~ However, the problem I am encountering is that this include statement does not work reliably. About 90% of the…
CodeRedd
  • 283
  • 1
  • 4
  • 14
3
votes
0 answers

How to read data from UART in MikroC

Anyone here using MikroC to implement UART? I'm trying to connect a PIC18F4550 and SIM900. I want to use UART1_Read_Text(variable, delimiter, attempts). But since there is no specific length of the text that will be received, I'm trying to use NULL…
Granger
  • 35
  • 1
  • 5
3
votes
1 answer

PIC16F887 receiving wrong UART Data

I'm making a cleaning robot in C (XC8) and I've got some problems with UART. Let me explain: The project got an UART communication between a PIC16F887 and a HC06. Before, the project has a PIC16F1455 and worked great. But I needed more and changed…
MAG
  • 133
  • 3
3
votes
3 answers

How can I increase the size of a memory block in MPLAB?

The Microchip PIC MPLAB (MCC18) compiler segments its memory into 256 chunks ( 0x100 ). How can I create an array larger than 256 bytes? char buffer[256]; Just to get to 256 I needed to make a seperate segment with a #pragma #pragma udata…
Justin Tanner
  • 14,062
  • 17
  • 82
  • 103
3
votes
2 answers

How can I use C macros to define PIC microcontroller pin names?

PIC microcontrollers have 3 basic registers to set GPIO (General Purpose I/O) pin status. These are: TRIS (Tri-status, the direction register. Sets the pin as in or out) PORT (The input buffer) LAT (Latch, the output burffer). Ports can be A, B,…
hjf
  • 453
  • 5
  • 16
3
votes
2 answers

Receiving SPI data via DMA on PIC32

I know that this topic (DMA & SPI) has already been talked about on numerous threads in the microchip forum, actually i've read all the 15 pages in result of the search with keyword "dma" and read all the topics about dma & spi. And I am still…
Yann Sionneau
  • 31
  • 1
  • 1
  • 2
3
votes
1 answer

Interrupt / Stack Pointers / PIC Microcontroller

I am currently working with the PIC16F1829 micro controller. However, I am stuck on interrupt routine appropriate execution method. I want the interrupt routine to exit out of the infinite loop in all of the functions (LED animations), that are…
RytisBe
  • 69
  • 8
3
votes
2 answers

Cant see printf in mplabX IDE anywhere... Why?

I tried this in a function, but I dont see anywhere the result in MPLAB X IDE. Why? Where I can find the printed result? I am using pic32 Curiosity development board and XC32. int a = 5; int b = 10; printf("a = %d\nb = %d\n", a, b); Any info?…
3
votes
2 answers

Pic Assembly how to

I am trying to write a program that contains a large list(about 4.8kbytes). The code is in assembly, but with an even larger data table (about 5.4kbytes).