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

Integer constants in PIC assembly: decimal vs. hex

I am doing programming in PIC based micro controller (microchip). The PIC model that I used is PIC16. I have issue on classifying the data type e.g. MOVLW xxxx where xxxx are the following:- 0x23: hexadecimal 23: decimal D'20': hexadecimal 1Bh:…
johnson lai
  • 996
  • 1
  • 11
  • 15
3
votes
1 answer

PIC18 variable declaration and initialisation fails in hardware

can someone help with this? In summary: declaring and initialising a variable does not work in PIC hardware – whereas it works fine in simulation. Also, this problem seems to be worse if the variable is a structure. I am using: MPLAB X IDE V3.55,…
StevedB
  • 51
  • 4
3
votes
1 answer

PySerial - Max baud rate for platform (windows)

I'm trying to get pySerial to communicate with a microcontroller over an FTDI lead at a baud rate of 500,000. I know my microcontroller and FTDI lead can both handle it as can my laptop itself, as I can send to a putty terminal at that baud no…
3
votes
0 answers

How can I handle 'processor mismatch' warnings without silencing them or including custom built copies of the dependencies?

I have a C project for a PIC that I am building with SDCC 3.6.3 and gputils 1.5.0, both of which I built from source. When linking my project, I get the following error messages from gplink: warning: Processor mismatch in "streams.o". warning:…
EchoLynx
  • 410
  • 5
  • 11
3
votes
2 answers

How to tell clang that my LLVM Target should use 16-bit 'int'?

For my PIC Backend, I want 'int' to be 16 bits. How can I / my target tell clang what should be the size of 'int'? Defining 16-bit registers only seems not sufficient. Currently "clang -O2 -emit-llvm -target pic" converts int foo(int a, int b) {…
3
votes
1 answer

Delay loop PIC assembly code not working on breadboard

I tried to program the PIC 12F675 so it would blink an LED diode connected to its GPIO 0 pin (pin number 7). I have set the pins to digital mode: clrf ANSEL I have set them all as outputs: clrf TRISIO and finally this is the loop I used: …
Avo
  • 53
  • 1
  • 7
3
votes
1 answer

PIC18F25K80 sending string through USART not working

I'm programming a few libraries for a board with a PIC18F25K80 built-in. Right now I'm trying to program the UART library and I've tried everything but I cannot make it work when it comes to send a string of chars. I'm using the XC8 compiler and I…
3
votes
0 answers

Writing to a PORT does not change its state

I have the following program - Using XC8 C Compiler on MPLAB and the microcontroller is PIC16F877. int main() { TRISB = 0x00; while(1) { PORTB = 0xFF; __delay_ms(1000); PORTB = 0x00; __delay_ms(1000); } return 0; } I have…
Nujufas
  • 676
  • 1
  • 9
  • 19
3
votes
3 answers

Can't extract an integer from a thermometer byte reading

Afternoon all, Apologies if this question is in the wrong format or in the wrong place, if this is the case, please flag and I'll change it or take it elsewhere. I am using a development board to send a temperature reading to an LCD panel and I am…
James
  • 356
  • 2
  • 13
3
votes
1 answer

Using an array to store pin bits

Just trying to make sure I'm on the correct track here. I'm trying to store lots of 6-bit bytes into an array to control a parallel device with my PIC18F2550. My array: char pins[4] = { 000000, //0 000001, //1 000010, //2 …
coolestDisplayName
  • 161
  • 1
  • 2
  • 9
3
votes
1 answer

PIC16F883 Led Blink

I need to program a PIC16F883 to blink / light up LED's at the same time. The oscillator is running at 3,2768, and I'm using TIMER0 to help me with the timing. Right now, I have a prescaler set to 1:256, so I get an interrupt every 50ms, and I have…
3
votes
1 answer

How to move a variable's value into another variable in assembly

I am trying to learn assembly programming with MPLAB X and a PIC18F1320 microcontroller. I have been following the MPASM User's Guide (http://ww1.microchip.com/downloads/en/DeviceDoc/33014J.pdf) and have gotten an LED to blink from the RB0 pin on my…
Display name
  • 721
  • 2
  • 11
  • 29
3
votes
1 answer

Is there any tool available to convert ASM to C for PIC 16F877A

I want to convert ASM file to C program. is there any tools available for this. My intention is to convert assembly program of PIC 16F877A program to C program...
Sijith
  • 3,740
  • 17
  • 61
  • 101
3
votes
1 answer

MPLAB/XC8 can't jump in ASM?

I have a project for the PIC18F25K50 of mixed C and Assembly; most of what I want to do I can easily manage (and must for efficiency) in Assembly, but some parts where I care more about ease of development use C. I actually have a couple of these,…
DigitalMan
  • 2,440
  • 5
  • 26
  • 32
3
votes
0 answers

trying to get a led blinking on pic18f25k80

I am trying to get a LED blinking on my pic18f25k80. The LED is connected to pin: RC1. I think that I might be missing some configuration. BR Fredrik #include void delay1s(void); void main(void) { TRISC = 0; OSCCON = 0xF2; …
Fredrik
  • 31
  • 2