Hi, I'm not sure if it's actually hardware related, since my ASM ADC-reading code works just well. I suppose I just have to tweak around the code and see if there's anything else wrong with it...
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.
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.
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
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.
However I'm not sure if the setting suggested by be80be might also work just as fine. As for now I'm trying to get the rest of the pins to turn on as well, which needs some relatively tricky tweaking with the code as well. I'll get to the pre-post-scaler part when I'm done testing the rest of the I/O pins of my PIC.
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
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
Anyway, I think some of the values I put to the registers might be wrong, but I'm not sure. Here's an overview of the association with PORTA: **broken link removed**