Keyboard with pic18f25k50 and pic18f45k50

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
paulwilsonn81
Posts: 3
Joined: 26 Dec 2021 18:19

Keyboard with pic18f25k50 and pic18f45k50

#1 Post by paulwilsonn81 » 28 Dec 2021 12:30

Greeting,

please help since i stopped with this project which i downloaded from libstock.
USB Mouse And Keyboard, Using Only One PIC Microcontroller
https://libstock.mikroe.com/projects/vi ... controller

since i bought pic18f25k50 and pic18f45k50 i tried to customize but whatever i tried has no chance of adapting to that processor.
the project works great with the old pic18f4550 but it is impossible to adapt it to a little newer and pic18f25k50 or pic18f45k50 processors.

I don't know where I'm wrong and I would ask you for help.

this is how i adjusted the processor settings
pic18.png
pic18.png (69.83 KiB) Viewed 893 times
I added this

Code: Select all

FSEN_bit = 1;
        OSCTUNE = 0x80; //3X PLL ratio mode selected
        OSCCON = 0x70;  //Switch to 16MHz HFINTOSC
        OSCCON2 = 0x10; //Enable PLL, SOSC, PRI OSC drivers turned off
        ACTCON = 0x90;  //Enable active clock tuning for USB operation
please help i don't know where i'm wrong

paulwilsonn81
Posts: 3
Joined: 26 Dec 2021 18:19

Re: Keyboard with pic18f25k50 and pic18f45k50

#2 Post by paulwilsonn81 » 05 Jan 2022 00:01

I can't believe there's no one who can help me get usb working,
i just need help to make usb work.

adrian.c
Posts: 8
Joined: 07 Mar 2022 15:13

Re: Keyboard with pic18f25k50 and pic18f45k50

#3 Post by adrian.c » 08 Mar 2022 09:19

Hello,

Did you receive some help regarding your issues? I am using a PIC18F24K50 using the INTOSC and attempted to adapt USB code successfully running on a PIC18F2550 but it doesn't work. I wrote the simplest program to blink an LED but the oscillation rates are all wacky! :(

Did you found help somewhere else?

Thanks.

adrian.c
Posts: 8
Joined: 07 Mar 2022 15:13

Re: Keyboard with pic18f25k50 and pic18f45k50

#4 Post by adrian.c » 10 Mar 2022 13:26

Hello,

I got my USB PIC18F2550 code to run on a PIC18F24K50 with INTOSC. I see that your fuses settings are off, according to the pre/post scaler values from the datasheet. Try setting OSCCON as follows for HFINTOSC/16 and set the fuses and frequency as per the images (selected is the PIC18F24K50 for my project, but that should work for the 25K50 too):

Code: Select all

OSCCON = 0b11111100;
cfuses1.jpg
cfuses1.jpg (229.21 KiB) Viewed 774 times
cfuses2.jpg
cfuses2.jpg (226.22 KiB) Viewed 774 times
cfuses3.jpg
cfuses3.jpg (215.42 KiB) Viewed 774 times
Hope that's useful for you or others with the same issues. Technical support from MikroE and the forum is really awful.

Best regards.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Keyboard with pic18f25k50 and pic18f45k50

#5 Post by filip » 11 Mar 2022 12:18

Hi,
Hope that's useful for you or others with the same issues. Technical support from MikroE and the forum is really awful.
I believe that the original project was not Mikroe's but user's, therefore we are not able to support it properly.

Regards,
Filip.

Post Reply

Return to “mikroC PRO for PIC General”