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
29
votes
8 answers

Difference between PORT and LATCH on PIC 18F

I already read the datasheet and google but I still don't understand something. In my case, I set PIN RC6 of a PIC18F26K20 in INPUT mode: TRISCbits.TRISC6 = 1; Then I read the value with PORT and LATCH and I have different value! v1 =…
acemtp
  • 2,971
  • 6
  • 34
  • 43
28
votes
4 answers

@ sign in C variable declaration

I found this header file for PIC microcontrollers by the name of pic1250.h and I'm unable to get the hang of some syntax used in it. The source for the file is: /* * Header file for the Microchip * PIC 12c508 chip * PIC 12c509 chip * …
Avi Gabhawala
  • 291
  • 3
  • 5
15
votes
1 answer

pic32 projects in visual studio 2010

Has anyone managed to configure VS2010 to build and debug embedded projects on PIC32 microcontrollers? Are there any tutorials out there? Using WinGDB i can connect to a gdb server to step through code from within vs2010 (have tested this compiling…
Tom
  • 626
  • 3
  • 8
15
votes
5 answers

Free alternative to MPLAB (PIC development)

I started using MPLAB recently, but for someone that works with Eclipse and VS the IDE it's very limited. Do you know any free IDE or how to configure Ecplise or Netbeans to PIC development? Thanks all
rnunes
  • 2,785
  • 7
  • 28
  • 56
14
votes
2 answers

Does 32bit x86 code need to be specially PIC-compiled for shared library files?

Compiling code to an object file needs to be done position-independent if the object file is intended to be loaded as a shared library (.so), because the base virtual address that the shared object file is loaded into in different processes may be…
Johannes Schaub - litb
  • 496,577
  • 130
  • 894
  • 1,212
14
votes
6 answers

Free PIC C compiler

I am looking for a free, and possibly open source C compiler for PIC. I might go without C, but I would like to get both options. There are various compilers out there, but since I have never done PIC development before, I am looking for user…
shodanex
  • 14,975
  • 11
  • 57
  • 91
13
votes
2 answers

Why does uint16_t make a difference here?

volatile uint16_t r; unsigned char poly = 0x07; unsigned char c = 0; r = (c << 8) ^ poly; When the code is compiled with gcc on Linux, r is 7. When the same code is compiled by Microchip C18, r is 0. Why? If I change it to: volatile uint16_t…
AndreKR
  • 32,613
  • 18
  • 106
  • 168
12
votes
5 answers

In Microchip C18, why does the insertion of a NOP cause much larger code?

I have some code in an ISR. The code is given for completeness, the question is only about the commented-out __asm_ block. Without the __asm_ block, this is compiled into 82 instructions. With the __asm_ block, the result is 107 instructions long.…
AndreKR
  • 32,613
  • 18
  • 106
  • 168
11
votes
1 answer

Writing a GSM modem driver?

I've been working on an application which uses a GSM modem for one of two things; check its status using the built in HTTP stack by sending a GET request to the server, or sending data to the server (using UDP). I have tried several different…
dantheman
  • 275
  • 2
  • 12
10
votes
1 answer

Does GCC support PIC (particularly the problematic PIC16 family)

Free PIC C compiler PIC16 C compiler ...aaaaand noone mentions gcc*. Googling lead me only to flame wars over the forums if PICs are suitable for C, and that their (at least the 6 - series) 30 instruction assemblers are very simple to learn. Does…
Vorac
  • 8,726
  • 11
  • 58
  • 101
10
votes
7 answers

What microcontroller (and other components) would I need to create a timer device?

As a hobby project to keep myself out of trouble, I'd like to build a little programmer timer device. It will basically accept a program which is a list of times and then count down from each time. I'd like to use a C or Java micro controller. I…
Bob
  • 97,670
  • 29
  • 122
  • 130
10
votes
1 answer

Arduino Fail-Safe Mechanism

Suppose I am developing a fail-safe mechanism for Arduino (Or any other microcontroller). In other words a secondary microcontroller or a seperate board should get the responsibility when the primary controller fails. Two possible mechanisms are as…
Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
9
votes
2 answers

Can I make a function that accepts both ram and rom pointers in Microchip C18?

When I declare a function that accepts const char* and I pass a string literal, I get a Warning: [2066] type qualifier mismatch in assignment because string literals are rom const char*. It's the same the other way around. Though the PIC is…
AndreKR
  • 32,613
  • 18
  • 106
  • 168
9
votes
4 answers

What is the best way of sending the data to serial port?

This is related with microcontrollers but thought to post it here because it is a problem with algorithms and data types and not with any hardware stuff. I'll explain the problem so that someone that doesn't have any hardware knowledge can still…
Chathuranga Chandrasekara
  • 20,548
  • 30
  • 97
  • 138
9
votes
3 answers

Best practice for function to handle 1-256 bytes

I have some functions that are designed to handle 1-256 bytes, running on an embedded C platform where passing a byte is much faster and more compact than passing an int (one instruction versus three), what is the preferred way of coding it: Accept…
supercat
  • 77,689
  • 9
  • 166
  • 211
1
2 3
99 100