The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.
Questions tagged [pic18]
230 questions
1
vote
1 answer
How do I turn a Fitec FS90R servo motor 90 degrees clockwise and anti-clockwise using a PIC18F4550
I have tried varying the duty cycle of the servo motor but it only turns 180 degrees clockwise and anti-clockwise.
user17862830
1
vote
1 answer
how to do interrupt service routine in pic18
#include
TIMER set 0x00
COUNT1 set 0x01
COUNT2 set 0x02
org 0x00
goto start
org 0x08
goto int_1
goto int_2
org 0x18
retfie
start movlw 0xFF
movwf TRISB,A
clrf TRISD,A
clrf TRISC,A
movlw…

Khairur Rijal
- 11
- 2
1
vote
1 answer
Difference between PORT and LAT on an PIC18F
I am currently working on a PIC18F and I wonder what the difference is between a PORT and a LAT because looking at the documentation of the PIC18F they both do the same thing.
1
vote
1 answer
PIC18f4550 XC8 compiler: LCD screen stop working when interrupt service routine function is enabled
Background
I am trying to make 16x2 generic LCD display(HD44780) shows some texts on the screen when data is received from HC-05 Bluetooth module via USART interface using PIC184550.
The simplified connection looks something like this:
I have…

Chris Aung
- 9,152
- 33
- 82
- 127
1
vote
1 answer
How to setup a function for multiple ADC input channels on PIC18F26K22?
I'm using a PIC18f26k22 to simply read two potentiometers (connects to analog pin AN0 and AN1). Working with a single pot is easy but more than one pot requires a bit-shifting technique which I haven't understood clearly. I did look around the…

Ankit Zyada
- 11
- 1
1
vote
1 answer
Program and Run PIC18 with pickit4 on linux
I am on linux ubuntu and target is a PIC18F47J53.
I basically want to program the chip and then let it run, using command lines and using pickit4.
using ipecmd (from mplab x ide v5.45), this is my…

random_name1978
- 43
- 4
1
vote
1 answer
Why my code on PIC18F XC8 causes few times per second interrupt extension?
I am new in PIC processors programming and I need a little help. I'm using PIC18F8680, programming in C with XC8 compiler in MPLAB X IDE v5.35.
I have two interrupts, high priority on timer 0 (5 kHz) and low priority on timer 1 (200 Hz). In high…

Svobi
- 11
- 4
1
vote
1 answer
how to handle http exchanges between a PIC18 and Firefox?
I'm working on a http communication project. The goal is to exchange http data (for exemple JSON data) between a PIC18F67j60 microcontroller (the PIC18 embarks on a Ethernet module) and a host computer via an Ethernet link. The computer acts as the…

Idash
- 55
- 8
1
vote
1 answer
Reserve Memory Directive "Res" Usage in PIC Assembly
I have started to convert legacy pic assembly code to C.
I learn the instruction set of PIC in my case PIC18F2585 but encouter the code phase which make variable definition:
MAINVAR UDATA
Sample1 res .1
…

Nazim
- 406
- 1
- 6
- 20
1
vote
1 answer
Timer 0 interruption on PIC18F
I am trying to make a program, that use a interruption for timer 0. The problem is I have to add a function with 2 variables.
Timer configuration will be performed by defining a function with the following prototype: void int_tmr0 (int conf_int,…

maximus383
- 584
- 8
- 25
1
vote
2 answers
pic 18F4550: local variable problem,
I'm using the pic18F4550 with microchip v8.63 and with the C 18 compiler. I'm using a LDR that retrieve the value of the led (not on my picdem board) (red, green and blue) these values are stored in a variable after each conversion. Afther that when…

projecten1
- 67
- 9
1
vote
1 answer
Following memory positions in assembly code
I need to find out what the purpose of this code is and how can I follow what the value of the memory positions are?
I've gotten the few few lines as down then I'm lost
MOVLW 3 ; W = 3
MOVWF 0x05, A ; (0x05) = 3
MOVLW 1…

Jimsati
- 21
- 2
1
vote
2 answers
Using PIC18F K40 microcontroller flash memory as storage
I'm using PIC18F67K40 microcontroller in my project.
It has 1kB EEPROM memory and 128kB program memory (flash).
For now I'm using EEPROM to store my settings.
Application is "growing" and I realized that at some point 1kB will be not enough. Some…

Kamil
- 13,363
- 24
- 88
- 183
1
vote
1 answer
How to send string in PIC18 via UART?
I'm trying to send and receive string to my PC via UART. My MCU is PIC18F65K40. The programmer is PicKit 3. The problem is that I receive some garbage values while programming the device, but after that noting happened. Almost the same code is…

NBE
- 23
- 3
1
vote
0 answers
Is this SPI and frequency counter program implemented correctly?
I am setting up a frequency counter on the PIC18F4585, which sends the frequency out via 8bit SPI.
I'm setting up a frequency counter in my PICF4584 that will calculate the frequency of a square wave going into timer/counter1, samples for 8ms timed…

Jaywalk
- 145
- 6