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
3 answers

Writing to EEPROM on PIC

Are there any PIC microcontroller programmers here? I'm learning some PIC microcontroller programming using a pickit2 and the 16F690 chip that came with it. I'm working through trying out the various facilities at the moment. I can sucessfully read…
jcoder
  • 29,554
  • 19
  • 87
  • 130
3
votes
2 answers

Receiving "undefined symbols" error with XC8 concerning plib I2C functions

Hey there StackOverflow! My question concerns errors being reporting within the program pasted (far) below. The target device is the PIC12LF1552, it has one serial peripheral on it that I assumed could be used in conjunction with the library…
James Lui
  • 195
  • 1
  • 7
3
votes
2 answers

pic32 jumping out of bootloader causes general exception

I have an mplabx project with a custom bootloader and application for the PIC32MX795F512L. All throughout its development, I have been jumping from the bootloader to the application with no problem using the line: ((void…
user545199
3
votes
2 answers

Microchip PIC16F1829 Deep Sleep

I'm struggling to get the PIC16F1829 to enter sleep mode. The unit draws around 18mA while the data sheet is quoting 20nA in deep sleep mode. Could anyone help? According to the datasheet I have to do the following "WDT, BOR, FVR, and T1OSC…
3
votes
0 answers

Build failed of downloaded .mcp file in MPLAB for PIC18F2550 and PIC18F4550

I have installed Mplab version 8.9, I have downloaded a firmware package from this link But, when I hit build all it shows me the following output and build fails: ---------------------------------------------------------------------- Debug build of…
jay
  • 31
  • 3
3
votes
1 answer

How to organise declarations and functions in code .h file and includes for best code re-use

Hope someone can help - apologies for this very basic question, but I'm using standard C to write code for some experiments with PIC microcontrollers, and I'm very new to the C Language. I have various logical groups of code, such as functions to…
Alex2134
  • 557
  • 7
  • 22
3
votes
0 answers

FreeRTOS & PIC24EP & Correct interrupt handling

I've been using FreeRTOS for a while now on my project and I have to say I love it. Tough i'm facing a bug which is killing me. My code contains a large amount of code, about 80 files and use several microchip stack and run about 10 tasks. The…
Damien
  • 1,492
  • 10
  • 32
3
votes
7 answers

PIC and XC8 Compiler issue

Im sure Im missing something simple, and obvious, but I am tired of searching for the answer. Im using a PIC16F688 and XC8 compiler. The compiler user manual says that there is a delay function __delay_ms(). It says that _XTAL_FREQ must be…
Terryl
  • 143
  • 2
  • 2
  • 10
3
votes
4 answers

C for 16f628, Program Counter goes haywire

I have a new problem here. I'm still learning C for PIC (xc8 compiler) and as a beginner project i'm doing a thermometer with the popular ds18b20 and a pic16f628 i had lying around. My program does behave good when it is allowed to run but while i…
zakkos
  • 163
  • 1
  • 11
3
votes
1 answer

XC8 error 224: illegal # directive (first line)

I'm using Microchip's XC8 compiler. They want me to #include instead of including a chip-specific header. However, when I add this code on the first line of my code, I'm getting the error: Error [224] C:\...\main.c; 1.4 illegal "#"…
user1544337
3
votes
1 answer

C18 pseudo variables

I'm looking for a way to make Jalv2-like pseudo variables in C using the C18 compiler. A pseudo variable is something that acts like a variable but actually is a function. In Jalv2, it's possible to make a pseudo variable like this: function…
user1544337
3
votes
1 answer

What does TDO on 4th bit in ICSP SendCommand header mean? (PIC32MX, ICSP 2-wire 4-phase)

Right now I'm trying to implement the flash programming specification for PIC32MX. I'm working with a PIC32MX512L and a PIC32MX512H. The PIC32MX512L must eventually transfer a program to the two wires PGEC2 and PGED2 of the PIC32MX512H. Right now…
indmg
  • 92
  • 6
3
votes
1 answer

PIC32 UART Drops bytes

The problem An external source sends these four bytes 0x2A, 0x42, 0x78, 0x25 The PIC32 UART Does not generate an int The external source sends one more byte The PIC32 UART then generates an int In that int, Only the 0x25 byte from the previous…
User.1
  • 2,562
  • 3
  • 33
  • 40
3
votes
1 answer

How do I set up emacs for PIC assembler code

I want to use emacs for drafting and editing assembler code that I can insert into Microchip MPLAB IDE for PIC projects. If I use .asm as the file extension I get a funny effect when I use a semi-colon in column one to start off a comment line --…
Harry Weston
  • 696
  • 8
  • 22
3
votes
3 answers

Bank switching in PIC mcu

Usually I do a banksel before every GPR access but I find that I have many unecessary lines. So, the question is this. I do some calls to subroutines that access diferent memory banks than the calling routine. Is it a good idea to save in a GPR, the…
tcop
  • 381
  • 1
  • 2
  • 11