Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 1024

PIC is a brand of 8, 16, and 32 bit RISC microcontrollers manufactured by Microchip. "PIC" originally was an acronym for "Peripheral Interface Controller".

1 vote
2 answers
1k views

in dsPIC33 assembler, can I use all of the w registers?

Most of my dsPIC3 application is written in C, but one function is particularly speed sensitive, so I had to write that function in assembler. The function looks roughly like this: _FunctionName: lnk …
Rocketmagnet's user avatar
  • 27.6k
0 votes

Why would btfss fail sometimes on PIC12f1822

Apparently this is caused by some kind of partial failure of the chip. I swapped out the part, and the problem has gone away. Turns out it was the hardware after all ;)
Rocketmagnet's user avatar
  • 27.6k
2 votes

Problems starting PIC18F4680

I don't know if the PIC can take 40MHz in. Normally we use a 10MHz oscillator and use the PIC's internal PLL to increase it to 40MHz. …
Rocketmagnet's user avatar
  • 27.6k
6 votes

How can I set the condition code in assembly language?

So, whenever I'm writing PIC C, I always check the assembly output to see if it looks sensible. And then, usually, write macros to perform the operations. …
Rocketmagnet's user avatar
  • 27.6k
10 votes
Accepted

What does this CAN bus waveform mean?

Turns out the answer should have been obvious from the waveforms above. When TX goes low, so does RX. But when TX goes high, RX takes more than 1us to rise again. That's more than a whole bit time! CA …
Rocketmagnet's user avatar
  • 27.6k
7 votes
3 answers
3k views

GND difference between CAN nodes?

I am running a short (2 m) CAN bus with about 20 nodes. 1 Mbit/s speed, PIC 18F2580s and 18F4580s with MCP2551 transceivers, 10 MHz (with PLL to 40 MHz) crystal oscillators. …
Rocketmagnet's user avatar
  • 27.6k
7 votes
2 answers
3k views

What does this CAN bus waveform mean?

I am trying to get the ECAN functionality working on a dsPIC33. I have two identical dsPIC33s, each with identical CAN transceivers connected by a short (3 inch) bus. One is transmitting, one is recei …
Rocketmagnet's user avatar
  • 27.6k
3 votes
2 answers
912 views

Why would btfss fail sometimes on PIC12f1822

The PIC is supplied with regulated 5v. Strangely, this problem only seems to manifest if I use 0v-5v input signals. If I use 0v-3.3v inputs, the problem seems to go away. … Is there any strange electrical property of a PIC which can make it miss read a port pin 1% of the time? …
Rocketmagnet's user avatar
  • 27.6k
3 votes
Accepted

How to get a PIC12F1822 running at 32MHz

I discovered the answer, and I feel stupid. Turns out that, while in MPLAB C you can write 0b11110000, in MPLAB ASM, you have to write B'11110000'. But the assembler wasn't warning me about this.
Rocketmagnet's user avatar
  • 27.6k
4 votes

Cheap PIC programmer, must be Linux compatible

Buy it, it's less than a tenner! The parts alone will cost you more than that. Plus the amount of time you spend trying to get it working will make you wish you'd bought it.
Rocketmagnet's user avatar
  • 27.6k
3 votes
1 answer
9k views

PIC32 PWM minimal example

I am having trouble getting a simple PWM output to work at all on a PIC32MX775F512H. Looking online, this seems to be all I need to get something working: int main(void) { SYSTEMConfig(SYSTEM_FRE …
Rocketmagnet's user avatar
  • 27.6k
1 vote
3 answers
1k views

How to get a PIC12F1822 running at 32MHz

I just can't get my PIC12F1822 to switch to 32MHz (8MHz + 4xPLL) I am telling OSCCON to switch to 8MHz, but, according to the debugger, that value is never loaded into it! I also wait for the High Spe …
Rocketmagnet's user avatar
  • 27.6k
4 votes

Problems communicating with I²C RTC

For some reason, I2C seems to be very confusing and poorly explained in datasheets. Plus the master tends to be very picky about you using it correctly, and the slave is likewise picky. Rightly so, I …
Rocketmagnet's user avatar
  • 27.6k
0 votes

PIC - Time to enter the interrupt

One good way to answer questions like this is to use MPLAB's simulator. If you enable the stopwatch you can see exactly how many CPU cycles, and how many microseconds everything takes:
Rocketmagnet's user avatar
  • 27.6k
1 vote

Extraneous loop produced by PIC compiler from MicroChip

I tried various optimisation options, but nothing made the compiler produce sane code. I have had similar experiences with the C18 compiler too. Some of the code it generates it amazingly daft, and I …
Rocketmagnet's user avatar
  • 27.6k

15 30 50 per page