cudno da pk2 ne prepoznaje 18f2550, morao bi da ga prepozna... ja imam original pk2 i nikad nisam imao problem da prepoznam 18f2550 ..
davno sam se drndao sa pickit2 sw-om ali neka logika...
config1H (bitovi za oscilator) bi trebalo da budu prva linija 11,10,9,8 sto mozes da pretpostavis i po tome sto su 7 i 6 bitovi "unimplemented" sto se slaze sa CONFIG1L dok za 1H unimplemented je bit4 sto se slaze sa ovim bitom 12 koji nije implementiran... sad bit13 je PCLKEN ne znam zasto u DS pise jedno a pickit pise drugo ...
isto ako pogledas CONFIG5 npr vidis da su 15 i 14 postojeci pa tek onda 0-3 sto se poklapa sa tim da su prvih 8 bitova (15-8) H registar a sledecih 8 (7-0) L registar
u tom slucaju tebi je oscilator podesen kao 1110 iliti RC oscilator sto sa 16MHz kristalom nikako nece raditi
ali, to je nagadjanje.. takodje, ako napravim bazicni fw za 18f2550
Code:
#include <main.h>
#include <18F2550.h>
#device ADC=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES HS
#use delay(crystal=16MHz)
void main()
{
setup_adc_ports(NO_ANALOGS, VSS_VDD);
set_tris_a(0);
set_tris_b(0);
set_tris_c(0);
while(TRUE)
{
output_a(0x00);
output_b(0x00);
output_c(0x00);
delay_ms(500);
output_a(0xff);
output_b(0xff);
output_c(0xff);
}
}
dobijem
Code:
:1000000019EF00F0EA6A060EE96EEF50D8B417EF68
:1000100000F0050E016E006A002EFED7012EFBD700
:100020002E0E006E002EFED700D0EF2EF2D734EF4A
:1000300000F0F86AD09EC150C00B0F09C16E070EC8
:10004000B46EC150C00B0F09C16E000E926E936E5C
:10005000946E926A896A936A8A6A946A8B6A020EBB
:10006000056EFA0E066ECED7052EFBD7926A89680A
:0C007000936A8A68946A8B68ECD70300DE
:020000040030CA
:0E00000003CC381E008781000FC00FE00F40B8
:00000001FF
;PIC18F2550
;CRC=4054 CREATED="16-Feb-22 22:25"
za koji pickit2 kaze da je config1 CC03
ako promenim u
Code:
#include <main.h>
#include <18F2550.h>
#device ADC=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES NOBROWNOUT //No brownout reset
#FUSES HSPLL
#use delay(crystal=16MHz)
void main()
{
setup_adc_ports(NO_ANALOGS, VSS_VDD);
set_tris_a(0);
set_tris_b(0);
set_tris_c(0);
while(TRUE)
{
output_a(0x00);
output_b(0x00);
output_c(0x00);
delay_ms(500);
output_a(0xff);
output_b(0xff);
output_c(0xff);
}
}
dobicu
Code:
:1000000019EF00F0EA6A060EE96EEF50D8B417EF68
:1000100000F0050E016E006A002EFED7012EFBD700
:100020002E0E006E002EFED700D0EF2EF2D734EF4A
:1000300000F0F86AD09EC150C00B0F09C16E070EC8
:10004000B46EC150C00B0F09C16E000E926E936E5C
:10005000946E926A896A936A8A6A946A8B6A020EBB
:10006000056EFA0E066ECED7052EFBD7926A89680A
:0C007000936A8A68946A8B68ECD70300DE
:020000040030CA
:0E00000003CC381E008781000FC00FE00F40B8
:00000001FF
;PIC18F2550
;CRC=4054 CREATED="16-Feb-22 22:32"
a pickit2 config ga opet cita kao CC03
sto ne deluje ok ... pa cu ga uprostim jos malo...
Code:
#include <18F2550.h>
#device ADC=10
#FUSES INTRC
void main()
{
setup_adc_ports(NO_ANALOGS, VSS_VDD);
set_tris_a(0);
set_tris_b(0);
set_tris_c(0);
while(TRUE)
{
output_a(0x00);
output_b(0x00);
output_c(0x00);
output_a(0xff);
output_b(0xff);
output_c(0xff);
}
}
C93F
a
Code:
#include <main.h>
#include <18F2550.h>
#device ADC=10
#FUSES HS
void main()
{
setup_adc_ports(NO_ANALOGS, VSS_VDD);
set_tris_a(0);
set_tris_b(0);
set_tris_c(0);
while(TRUE)
{
output_a(0x00);
output_b(0x00);
output_c(0x00);
output_a(0xff);
output_b(0xff);
output_c(0xff);
}
}
CC3F
a
Code:
#include <18F2550.h>
#device ADC=10
#FUSES HSPLL
void main()
{
setup_adc_ports(NO_ANALOGS, VSS_VDD);
set_tris_a(0);
set_tris_b(0);
set_tris_c(0);
while(TRUE)
{
output_a(0x00);
output_b(0x00);
output_c(0x00);
output_a(0xff);
output_b(0xff);
output_c(0xff);
}
}
CE3F
dakle sada se lepo vidi da se "levi" bitovi (15-8) menjaju kada se menja tip oscilatora ..
jedino sto nema nikakve veze izmedju ovoga sto ja vidim ovde i onoga sto si ti video u datasheet-u za tip oscilatora :D ali bice da si gledao pogresan datasheet... ako pogledas ovde:
https://ww1.microchip.com/downloads/en/devicedoc/39632e.pdf
videces na strani 294:
Code:
FOSC3:FOSC0: Oscillator Selection bits(1)
111x = HS oscillator, PLL enabled (HSPLL)
110x = HS oscillator (HS)
1011 = Internal oscillator, HS oscillator used by USB (INTHS)
1010 = Internal oscillator, XT used by USB (INTXT)
1001 = Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
1000 = Internal oscillator, port function on RA6, EC used by USB (INTIO)
0111 = EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
0110 = EC oscillator, PLL enabled, port function on RA6 (ECPIO)
0101 = EC oscillator, CLKO function on RA6 (EC)
0100 = EC oscillator, port function on RA6 (ECIO)
001x = XT oscillator, PLL enabled (XTPLL)
000x = XT oscillator (XT)
sto tvoj config cita kao HSPLL