PIC is a brand of 8, 16, and 32 bit RISC microcontrollers manufactured by Microchip. "PIC" originally was an acronym for "Peripheral Interface Controller".
-2
votes
1answer
78 views
I2C protocol for PIC18F45K20 with C18 compiler
I'm currently trying to receive data from the 2-wire serial interface of an image sensor with a PIC18F45K20 written with C18 in MPLAB X IDE v. 1.41. How do I initialize the I2C protocol and how do I ...
2
votes
2answers
150 views
ExternalDifferential ADC Values for PIC
I have a temperature sensor design that I'm using as a reference. It takes 2 RTD sensors and reads their values with a Dual Channel 16-bit Differential ADC. The ADC interfaces through the SPI bus.
...
2
votes
2answers
111 views
How can I control 8 LEDs with a timing delay with only one microcontroller (PIC12) written in Assembly?
I can have 5 I/O pins enabled. I'm just confused on how to control them individually.
6
votes
3answers
264 views
Switching from PIC to AVR [closed]
I have worked with PIC16 and PIC18s for over three years now and would like to get to know AVR as well. I have no specific project in mind, but would like to try around with the different ...
-2
votes
1answer
77 views
How to search date wise in flash memory using microcontroller?
I am developing a data logger in which I am using 8 MB of flash memory to store the sensor data with date and time. I am using RF interface to transfer that data to PC. I am planning to have PC ...
2
votes
1answer
99 views
Bit Banging UART
My full code is located here.
Basically, I'm transmitting to an Arduino, and I'm not receiving the correct value (you'll notice I'm trying to send d'22'). Here's the method where I actually bit bang ...
2
votes
2answers
91 views
Char array at an int in C18
In Jal, it's possible to do something like this:
var word the_var = 0x1234
var byte the_array[2] at the_var;
Now you can easily access the bytes of the word ...
0
votes
1answer
116 views
How to use the PIC16F628A's PORTA,4-7 as inputs?
I'm working on a countdown timer and I want to use the MSN of PortA for my switches.
I'm using MPLAB. I can't use C to program the PIC because the collage taught us to program in decimal, and they ...
1
vote
2answers
106 views
Receive bytes from UART camera
I am using a dsPIC33E MUC to interface an UART camera(VGA) at 115.2Kbps. The purpose is to save an image to a SD card.
The program I wrote works well except that it's inside a loop checking if the ...
5
votes
1answer
178 views
Serial Communication over 1 Pin?
Okay guys, I'm in a bit of a pickle here. I have the following circuit:
As you can see, pin 3 is my only output. I've actually already had this board printed, so there's not much room for ...
6
votes
3answers
153 views
How to calculate day of the week for RTC?
I am using MCP7940 RTC from microchip it requires to enter the day of the week as part of updating RTC with date. So how should I calculate day of the week based on the date provided by the user ?
0
votes
2answers
77 views
How to Synchronize two RTC module one internal and other external?
I am developing a data logger based on PIC controller. The PIC has internal RTC but does not have pins for connecting battery so I am using pic's internal RTC to generate interrupt every second and ...
3
votes
0answers
99 views
SPI Read returns only 0 in slave when I hook up SS to INT
I am coding a SPI slave using a PIC16F877A in CCS C and need to be aware when the SS line (pin 7) goes from high (idle) to low (active) as information from the master is framed as a stream of bytes ...
5
votes
3answers
300 views
Ethernet connector and transformers
I'm working on an Ethernet connection for a PIC18F4620 with the ENC28J60. I found a useful article here, with a schematic:
I see I need transformers between the RJ45 connector and the Ethernet ...
1
vote
0answers
104 views
Writing an emulator for a SPI like slave device (LED Driver PT6959) using a PIC
I am working with a legacy device that uses a "SPI like" protocol. This device acts like a:
SPI "master", but expects to talk with only one "slave" device. It
does not expect any output/data ...
3
votes
4answers
301 views
Implementing an I2C buffer in C
I'm implementing a read-only I2C slave on a PIC18F4620. I have made a -working- ISR handler for the MSSP module:
...
2
votes
1answer
96 views
Would a high priority interrupt interrupt another high priority interrupt?
In the datasheet of the 18F4620 and others, section 9.0 (page 91), I read:
The PIC18F2525/2620/4525/4620 devices have multiple interrupt sources and an interrupt priority feature that allows most ...
2
votes
2answers
140 views
I2C pull-up resistors calculation & where to place them
I'm connecting a PIC18F46K22 (master) to a PIC18F4620 (slave) using I2C. The wire between the devices is ~30cm. I'm using 400kHz without slew rate control. Later on, I'll add another 18F4620 on ~5cm ...
7
votes
1answer
140 views
What is slew rate for I2C?
I'm configuring I2C on a PIC18 using the built-in functions of the C18 compiler as described in section 2.4 of the documentation:
...
1
vote
1answer
47 views
Get bytes from a short long in C18
I'm using the C18 compiler and need to get the three bytes of a short long from MSB to LSB. I'd say I could use this:
...
4
votes
1answer
105 views
Which SPI mode to use?
I'm interfacing a 23LC1024 SPI Serial SRAM with a PIC18, using the C18 compiler and the built-in functions from <spi.h> as described in the Compiler ...
1
vote
4answers
173 views
Different ASCII Characters in RS 232
I'm working on the UART communication of PIC18F4520. I have tried simulating the code on ISIS proteus and then also checked the real time result. One thing I am quite confused about is that the ...
7
votes
2answers
79 views
Detecting overflow with C18
I'm implementing a calculator in a microcontroller which is controlled over the serial port. For example, I'd send 1234*5678= and it would reply with ...
3
votes
1answer
72 views
Integers >9999 in PIC C18
In this answer, I made a function to convert an integer to an ASCII string:
...
5
votes
5answers
287 views
Integer to ASCII in C18
I'm writing code for a PIC18F46K22 using the C18 compiler. I want to write the value of an integer \$n\$ in ASCII over the USART to my PC.
For \$n<10\$, it's easy:
...
1
vote
1answer
60 views
DS1077 to drive a PIC's clock
I found the DS1077, a "dual-output, programmable, fixed-frequency oscillator". I was wondering if it would be possible to let this chip provide the clock signal for the PIC(18F46K22) that operates the ...
0
votes
0answers
102 views
RF Link with APC220 between two PIC16F877's
I am attempting to communicate through a RF link between two PIC16F877's using APC220 Radio Transients. When the PIC UART's are connected with wires between TX and RX they communicate just fine, but ...
0
votes
2answers
99 views
Read from UART seems to overwrite while in buffer
I am reading sending data to a PIC32MX7xx using UART. The data frames are all 6 bytes long, no exception.
The problem I am facing is that when there are 6 bytes waiting to be read and I send another ...
2
votes
2answers
79 views
What is the best way to switch between different ranges when designing a multimeter using microcontroller?
We are developing a multimeter using a PIC18 microcontroller and we are searching for the best method to switch between different ranges in multimeter with the smallest possible amount of switching ...
1
vote
3answers
144 views
Controlling 8-bit DAC Output over I2C— decimal to binary char conversion help
Clarifying my question a bit. We're using a PIC32 board with an MCP4706 8-bit DAC, controlled over I2C. If we write a binary value (e.g. 0b00000100) to the DAC, it outputs as expected. However, ...
2
votes
0answers
136 views
How do I convert this analog PID to a digital one?
I want to transform a type III analog PID into a discrete-time one so I can implement it on a PIC18F. The controller is for a buck converter.
When I apply the bilinear transformation to the analog ...
0
votes
1answer
60 views
PIC24H delta time calculation
Hello I'm making a project for my intro embedded software class and I need to make use of a timer in a program. If I'm not mistaken this code should be looping the while for at least 500 ...
-1
votes
1answer
76 views
PIC24H POT input to control LED blink delay not linear
Hello I'm using the PIC24H microprocessor and I wrote a simple program that takes input from a POT using analog input which is then set to a modulus value of delay. It does seem to set the delay, but ...
3
votes
1answer
83 views
Difference between USART's synchronous and asynchronous mode
I'm writing software to initialise the EUSART1 module for RS232 on a PIC18F46K22. I'm using the usart.h library, built-in in the C18 compiler. There is some reference in MPLAB C18 C Compiler Libraries ...
4
votes
2answers
141 views
What transistor to use when building a simple MCU controlled LED blinking circuit?
This is my conceptual schema to use a PIC12 to control the blinking of 3 LEDs with different blinking patterns. I have a few questions that would like to ask.
Is this circuit going to work?
What ...
2
votes
0answers
61 views
PIC16F877A latchup/glitching
I have a PIC16F877A microcontroller with a 19.6608 MHz crystal, wired for 12V ICSP. I can reprogram the chip just fine, and it runs almost flawlessly (it's blinking an LED right now as I type). Only ...
0
votes
3answers
131 views
Connecting more than one serial device to PIC16f877a
In my project i need to interface a gps receiver and a gsm modem to pic16f877a, But there is only one set of UART lines in this Microcontroller. Is it possible to multiplex these two devices using ...
-2
votes
1answer
82 views
spidev_test.c analysis [closed]
I'm trying to connect a Raspberry Pi with a PIC32 through SPI. For RPi I'm using the spidev_test.c code (I'm modifying it to suit my needs) but... because I'm a novice in programming hardware, I'm ...
0
votes
4answers
148 views
How do I get started with PIC programming? [closed]
So I opened up a big bucket o' worms asking this question. Two of the answers mentioned that instead of using a 555, a PIC10F200 or PIC12F675 may do the trick.
Now, I've been spoiled with Arduino's ...
4
votes
4answers
195 views
uC platforms to consider for faster CPU and 30+ GPIO pins
I am building a Persistence of Vision project with 120 RGB leds (=360 total lines to be controlled). We have settled on the TLC5940 for driving the LEDs (and could be open to changing this), however, ...
0
votes
1answer
200 views
Can I remap a car\bike ECU using CAN bus?
I am thinking to use something like this to connect an Arduino to a motorbike engine control unit (ECU): Arduino CAN-Bus Shield with uSD Card Holder.
I never did something like this; using CAN bus, ...
6
votes
3answers
251 views
How do I program a PIC12?
I have a PIC12F675 that I need to program. I'm using a Pickit 2 and the Pickit 2 software. Supposedly I should be able to program it using this circuit, but the Pickit 2 software is not detecting the ...
5
votes
1answer
165 views
What does the USB bootloader do in the PIC microcontroller
I was wondering what does a boot-loader do, there is one USB Bootloader for the PIC micro-controller and I was wondering as to what its purpose is. How is it different from creating some HID device ...
2
votes
1answer
91 views
PIC18 - problems getting inline assembler routine to work
(EDIT: Added C18 disassembly code)
I need to optimize a function written in C for a PIC18f4585. I am using C18 to compile.
The function I am trying to re-write in assembly is:
...
2
votes
2answers
97 views
Programming a PIC with a PIC
I'm building a device with two PICs, a PIC18F46K22 and a PIC16F88. I have a buffer on the 18F46K22 which contains a program that I want to write to the program memory of the 16F88. I can't do this ...
3
votes
1answer
159 views
5
votes
1answer
119 views
How can I lower output impedance of an accelerometer?
I'm planning to use an accelerometer with a microcontroller to measure acceleration. The issue that I have ran across is that in PIC microncontrollers the ADC requires that the connected analog ...
2
votes
2answers
174 views
PIC16F723A Programming
I am working with a PIC16F723A chip and I am trying to program it to toggle a pin (RA1) on and off. I am pretty sure I have the circuit setup correctly (below is what I have setup), but for some ...
3
votes
2answers
109 views
PIC turns on with the Rx pin
If I connect the Rx pin of my PIC18F2550 and GND to another already powered-on circuit, the PIC turns on and starts running code. There is nothing in the datasheet preventing this.
Is this normal?
...
2
votes
1answer
66 views
Can I use Eclipse CDT to debug a PIC18 using PICkit3?
I'm curious and interested in buying a PIC18 micro and a PICkit3 to do some programming on a breadboard, to learn a bit. I like using Eclipse CDT for C development quite a bit.
Is it possible to use ...



