Questions tagged [pic18]

The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.

230 questions
0
votes
1 answer

PIC18f45k22 serial framing error with 64Mhz clock

I'm trying to transmit serial over the pic18f45k22 eusart peripheral. The messages get sent exactly as expected when the clock is running at 16Mhz, but if I set the PLL to on (so that the the oscillator runs at 64Mhz), I get a framing error. I have…
Huggzorx
  • 144
  • 1
  • 13
0
votes
0 answers

error: Executable code and data must be defined in an appropriate section with PIC asm in MPLAB v4.50

I am working of a code but I keep having an error when I try to run. I pasted the error below and I also added a screenshot. Thanks for the help.. Title "PIC18F452" List p=18F452, f =inhx32 #include ;This is a header file REG00 …
0
votes
1 answer

PIC18F OSCCON Register Requied if I define OSC = INTIO1?

New to microcontrollers, need to wrap my head around this basic thing: So, I'm trying to program a PIC18F4520, I know I can set an external clock using #define OSC = HS and connecting the crystal between the required pins. I have a doubt that is, if…
0
votes
0 answers

Interfacing sensirion SHT31 with PIC18F2420

Has anyone successfully interfaced this temp/humidity sensor with a PIC18F? I've been using Sensirion's sample code provided I'm using Adafruit's SHT31 breakout board which already has the 10k pull up/down resistors. I think I'm getting close to…
ZFENG
  • 11
  • 3
0
votes
1 answer

Configure settings for external oscillator in MPLAB X IDE v3.65

I am using a PIC18F45K20 to take in an external oscillation from a 25Mhz crystal instead of using the internal clock. However, what do I include in the code to set this external oscillator as an input (I presume OSC1 on PIC device)? Below are the…
noobling
  • 21
  • 5
0
votes
1 answer

delay function in for PIC18F4550

Is there any delay function can be used to PIC18F4550 in C programming, similar to delay() and delayMicroseconds() in Arduino? The delay functions that can find are Delay10KTCYx(), Delay10TCYx() and etc which is very difficult to generate the delay…
0
votes
2 answers

Invensense IMU3000 with microcontroller PIC

Has anybody experienced using the Invensense IMU3000 with some microcontroller? I am trying to build the IMU library for a PIC but I am stuck with the dependencies.. any other experience with others microcontrollers will be nice as well! Basically I…
stef
  • 737
  • 4
  • 13
  • 31
0
votes
1 answer

PIC18 Some strange in addressing

I have some missunderstanding in PIC18 addressing (as i see). So there is a part of lst file generated by XC8. At the end of code we can see the switch/case operator compare block, which then branches to case parts. So lets get two consistent labels…
EugenOS
  • 31
  • 6
0
votes
1 answer

pic18f communicating with lcd module

I'm developing on a pic 18Fxxx (18F452) in assembly. I'm in a learning phase so I'm doing different simple exercise with the final goal to develop a "real" project. At the moment I'm stuck with the LCD Module, I couldn't find any examples of a…
Abaco
  • 525
  • 7
  • 26
0
votes
1 answer

keystroke interrupt for PIC microcontroller

I am writing a code where the user can press a key corresponding to the information the user wants to know and print it on the LCD Display. So far I am able to write the code to print on LCD but I am not able to figure out how to ask MCU to wait for…
EEE
  • 1
0
votes
3 answers

Control relay from PIC18 microchip

I have a PIC18F24K20 microchip, and wants to control a relay. It works fine from my RasPI over GPIO - but i cant get it working trough my microchip. My test program is this: #include #define R1 LATBbits.LATB0 #define R1_TRIS …
pajzo
  • 202
  • 3
  • 12
0
votes
3 answers

ADC of pic18f452 is not getting exact value of voltage divider ?

I am using PIC18f452 in boost converter. For the control of Boost converter output voltage (200V) , i used feedback resister (R1=99K ohm , and R2 =2.5K ohm). The voltage across R2 is 5V with the input 200V. V2 = (2.5)/(99+2.5) *200 = 4.92 V when…
Misal313
  • 169
  • 2
  • 8
  • 23
0
votes
1 answer

Ways to display numbers in assembly language

In the following code below I am not sure what the D'93' and D'122' mean. The only time I have used assembly in the past hexadecimal numbers or binary numbers have been used. What does this notation mean and how can I convert into something I can…
user3095790
  • 27
  • 2
  • 7
0
votes
1 answer

transferring a number using serial port

I want to write a program to read a number from dipswitch and transfer that number using rs232 protocol(serial port). this program is written in assembly language. I have used PORTB as an input port and it is connected to dipswitch in order to get…
nazila
  • 15
  • 6
0
votes
1 answer

Interfacing Pic18 with mmc/sd

I want to communicate an Pic18 with an MMC to build a dataLogger. I already tried to use the mmc_spi.c standard library to send a simple sentence to the MMC but I can´t even initialize it without error. Can anyone help me? #include…