Some 18F nomenclature but in German, so maybe use google translate?
All the PIC32's have a 'part number decoder page' for example page 328 "PRODUCT IDENTIFICATION SYSTEM" in PIC32MX1XX/2XX
or page 656 "PRODUCT IDENTIFICATION SYSTEM" in PIC32MZ Embedded Connectivity (EC) Family
AFAICT, all PIC datasheets have similar part-number-encode/decode pages. However, I'm only interested in PIC32.
Wikipedia PIC microcontroller/Family core architectural differences
That divides the families by instruction size, and gives a useful summary of the 12bit, 14bit, enhanced 14bit, 16bit, 16bit dsPIC, PIC32 devices. Like many other microcontrollers, the 'natural' data size and instruction size can be different.
Edit:
I'm not a PIC24 person. Looking at the datasheets for PIC24FJ256GB210 and PIC24FJ256GB110, PIC24FJ256GB210 has 96kB RAM vs 16kB RAM for PIC24FJ256GB110
Typing the part numbers into "Search Microchip" at Microchip usually gets to a brief summary of the part, and links to more information.
For example PIC24FJ128GA010
Typing the part numbers into "Search Data Sheets" at Microchip will get to the device datasheet directly. Data Sheets usually has a summary of each family part on the first real page (page 3?). The table is often good enough to compare across similar families, and identify the differences.
I will start with mistakes on the circuit:
- The oscillator is not connected properly.
- I think you should not limit the LCD current with resistor and capacitor. (R2,C1)
- In Proteus, you do not have to simulate 5V, since the PIC pins are connected to Vcc(5v). You can replace all connection for 5V to Vcc, it is same.
- Make sure you are supplying 7805 with enough Vin. (check datasheet)
Mistakes in the code:
If you are using XC8 compiler as you stated, you should not include all these:
If you are totally sure that you want to use the specified header, then include it.
#include <p18F4550.h>
#include <stdio.h>
#include <stdlib.h>
#include <delays.h>
#include <string.h>
Instead you should include only:
#include <xc8.h>
It will include all headers needed.
I also can not see the configuration bits in the code. Include them too.
It might be all this shifting left and right which makes your code not work properly. Instead of shifting right or left, I would print the whole screen at once. Example:
while(1)
{
lcd_reset();
input++;
fragment(input);
string_display(text1);
char_display(number[0]);
char_display(number[1]);
char_display(number[2]);
string_display(text2);
}
Best Answer
I don't know why you're using such a ancient PIC in a new project, but there is no reason it shouldn't work.
Scaling 24 V signals down to 5 V is as easy as a resistor divider. Something like this should work:
The resistors attenuate 24 V to about 5 V. The zener guarantees the voltage into the PIC is within what it can handle because stuff happens. The zener will also clip negative spikes, but to one diode drop, which is right about where the PIC starts misbehaving.
If you are really worried about negative spikes, then you can put a Shottky diode across the zener just to clip negative voltages. Or you can break up R2 into two resistors that attenuate a bit after the zener, and use a bit higher voltage zener to compensate.
There are lots more things you can do. It depends on how much you want to protect against. More protection will add complexity and cost, but robustness to ever less likely abuse. Only you can decide what the right tradeoff is.