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

Is it possible to create multi-threading program for PIC12 MCU in HI-TECH C

My friend asks me to help him write a small program for PIC12 MCU. We want The program stops running when input voltage is less than 1.9V during 2 seconds. The program reacts immediately when input voltage exceeds 2.5V. I try to solve the 1st…
Allopopo
  • 171
  • 1
  • 9
2
votes
2 answers

PIC C18: Reading bits from a byte

I have a very elementary question. However, what ever I tried, I couldn't successfully implement this. I have a shift register (74LS164) connected to PIC18F2550 with the following hardware configuration: // Data pin #define SCLCD_DATA …
hkBattousai
  • 10,583
  • 18
  • 76
  • 124
2
votes
3 answers

Remake of Fletcher checksum from 32bit to 8

Is this conversion right from the original? uint8_t fletcher8( uint8_t *data, uint8_t len ) { uint8_t sum1 = 0xff, sum2 = 0xff; while (len) { unsigned tlen = len > 360 ? 360 : len; len -= tlen; do { …
Christian
  • 1,548
  • 2
  • 15
  • 26
2
votes
3 answers

How do the bank switching in PIC assembler?

I'm getting confused by bank switching in PIC assembler... This works for putting a 'Q' on the usart: bsf PORTB,1 ;Set Transmit DIR (PORTB (0x6) not mirrored in other banks) movlw 'Q' ;'Q' to work reg movwf TXREG ;work reg…
c0m4
  • 4,343
  • 10
  • 35
  • 40
2
votes
4 answers

Array of pointers to arrays. Printing strings in PIC18 MPLAB IDE

I am writing a C-code to use in PIC 18 micro-controller using MPLAB IDE. I have 5 strings and I want to be able to use pointers. The idea is having an array containing the pointers to the string arrays. and have them print on the console. The code…
Stkabi
  • 121
  • 2
  • 3
  • 8
2
votes
1 answer

PIC programming which bits are which in TRIS register

I am trying to understand PIC18 code in a format like TRISB &= 0b11100000. What is the order the individual RB pins appear in? i.e. is this register setting RB0-RB2 as input, or RB5-RB7 as input?
Cheetaiean
  • 901
  • 1
  • 12
  • 26
2
votes
8 answers

Microchip Linker problem

when i was trying to build my project in MPLAB,i got this Build error message.. Clean: Deleting intermediary and output files. Clean: Deleted file "M:\12 CCP PWM\12 CCP PWM.o". Clean: Done. Executing: "C:\MCC18\bin\mcc18.exe" -p=18F46K20 "12 CCP…
kyw
  • 6,685
  • 8
  • 47
  • 59
2
votes
2 answers

PORTB and INT external interrupts stucks the code

I am working on a project with PIC16F877 (using MPLABX). I use RB0 pin external interrupt and RB4 pin portb interrupt to detect zero cross detection. I did everything correct, in proteus simulation everything was okey. Then I set up the circuit on…
El_Canario
  • 41
  • 3
2
votes
1 answer

PI negative controller output to unsigned duty cycle

I am trying to implement a PI controller in C that outputs / controls a PWM's duty cycle on a microcontroller. The duty cycle that I can write to the certain PWM control register is limited to 10bit (values 0 - 1023 correspond to 0% - 100% duty…
Alles Klar
  • 31
  • 4
2
votes
1 answer

Track Minimum Value of a Signal In Real Time

I'm currently tracking the analog value of a photodetector coming into my system. The signal itself is cleaned, filtered (low pass and high pass), and amplified in hardware before coming into my system. The signal has a small amount of DC walk to…
Adam
  • 44
  • 8
2
votes
1 answer

MPLAB gives Low power and device failed to connect error when programming pic18f25q10

I am trying to add a simple led application to a PIC18F25Q10 in another circuit using the Curiosity HPC development board. I am using the MCLR, PGD, PGC and GND pins. Although I set the LVP mode to enable in the CONFIG settings and the program speed…
fthelb
  • 23
  • 5
2
votes
1 answer

Compiler warnings with SDCC

Using SDCC 3.0.0. Compiling this code #include < pic16f84.h> void main(void) { TRISA0=0; RA0=1; } and receive these warnings. daedalus@Eurydice:~/Projects/PIC$ sdcc -I /usr/share/sdcc/include/pic -p16f84…
Michael
  • 281
  • 1
  • 5
  • 12
2
votes
1 answer

PICKLE Pic Programmer on RPi 4 Model B

Has anybody used this application PICKLE https://wiki.kewl.org/dokuwiki/projects:pickle with a Raspberry Pi 4 Model B? PICKLE is an application developed in "C", which allows the RPi to use its GPIO pins to program a .hex file in a number of PIC…
vpappano
  • 111
  • 1
  • 11
2
votes
1 answer

Assembly of PIC

The address of str is stored the stack(can use pop to fetch it, and it's position independent): .text str: .string "test\n" But now the address of str is not in the stack(can't use pop to fetch it, but str(%rip)(RIP relative…
Je Rog
  • 5,675
  • 8
  • 39
  • 47
2
votes
1 answer

Problem calling in PIC C18, parameters garbled - using pointers to structures perhaps?

I am trying to make a fairly simple call using PICC18. Using the MPLAB simulator I am seeing the arguments, even on entry to the function, being completely garbled. I have the following typedef typedef struct { // t_ax25AddressChar…
Richard Corfield
  • 717
  • 6
  • 19