Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yes it does make an ASM file.
I think it's probably hardware related, ie xtal not plugged in, LEDs turned off, MCLR pin not handled correctly etc.
Your oscillator frequency should be 48mhz not 20mhz
**broken link removed**
You also need to set ADCON1 right.
void main() {
ADCON0 = 0B00111100;
ADCON1 = 0B00001111;
LATB = 0;
TRISB = 0B00000000;
LATB = 0B11111111;
while(1);
}
Hi, thanks for the input. I put the value of ADCON1=0X0F, I suppose that should set all of the pins as output, yeah?
Also, can you explain why I need it to be 48 MHz? I'm not using it for USB purposes at the moment.
bit 1 PBADEN: PORTB A/D Enable bit
(Affects ADCON1 Reset state. ADCON1 controls PORTB<4:0> pin configuration.)
1 = PORTB<4:0> pins are configured as analog input channels on Reset
0 = PORTB<4:0> pins are configured as digital I/O on Reset
I posted why I don't no where it went but any way Your using a 20 mhz crystal you divided it by 5 that gives the 4 mhz that's scaled to 96 then divided by 2
which is 48 mhz it's not 20mhz If you want 20 set the FOSC to HS only
One more thing you can turn off the A/D on PORTB in the configure to
Hi Mike, yeah, the one which worked is according to the settings you suggested. Thanks.I'm sure I said to set the postscaler to divide by 4 which would give you 24MHz.
Mike.
I'm sure I said to set the postscaler to divide by 4 which would give you 24MHz.
Mike.
I went back and looked your using a divide by 4 which gives a 24Mhz like Mike said But in your pic you show 20 which is wrong it will make thing like uart not work and things with timing
The reason I said divide by 2 is that's the default setting for the PIC18F2455/2550/4455/4550 in MikroC sorry about that
I been using the start usb which has the 18f2550 on it which uses the same setting
void main() {
CMCON=0B00000111;
UCON=0B00010000;
ADCON0=0B00111100;
ADCON1=0B00001111;
CVRCON=0;
LATA=0B000000;
TRISA=0B000000;
PORTA=0B111111;
while(1); }
Hi Atomsoft, thanks for the feedback.
What's the reason behind the orientation anyway?
Seems you cleared LATB first and then put it all on HIGH.
Vizier87