Page 3 of 3

Re: PIC18F15Q41

Posted: Mon Sep 22, 2025 12:04 pm
by BenR
Hi Dirk,

Should be resolved for you now, many thanks for letting us know.

Re: PIC18F15Q41

Posted: Tue Sep 23, 2025 11:30 am
by DirkB
Hello Ben,

I have ported a project from the PIC18F14K22 to the PIC18F15Q41. All functions are OK, but the OSC speed feels like 1/10 or less. I set INTOSC to 64MHZ and inserted the C code OSCFRQ=0x08;. The problem persists. Could you create and post a small project with the settings 64MHz, Oscillator Start-up Timer on, everything else off? Which parameter is responsible for the Analog-to-Digital Converter RC Oscillator (ADCRC)? Have I overlooked something?

Thanks,
Dirk

Re: PIC18F15Q41

Posted: Tue Sep 23, 2025 2:47 pm
by DirkB
OK, the OSC speed feels like 1/100 or less.

Re: PIC18F15Q41

Posted: Fri Sep 26, 2025 4:00 pm
by DirkB
Hello Ben,

I have flashed a chip with a small program containing the components EEProm, Serial-EEPRom (i2c), Digital Pot (i2c), PWM, and UART (Midi). The timing is OK. PWM 62.5 KHz is correct. Clock out 16 MHZ (FOSC/4) is correct. The compiler runs without errors.
PWM works, interrupts work, digital potentiometer works. Internal EEProm does not work, Midi does not work. I wrote a routine that initializes the EEprom and the Serial-EEprom and writes a specific value to a specific address of the EEprom. The next time the program starts, this address is read. If the value is correct, the EEproms are not initialized. However, the EEPROMs are initialized at every restart. The value is not written. As soon as I add the i2c component to the project, the overall speed drops dramatically. Initialization takes about 2 seconds with the PIC18F14K22, but with the 18F15Q41 it takes 20 seconds or more, and the EEPROM does not write (or read?) the value to the address.
Otherwise, it looks very good.

Best regards,
Dirk

Re: PIC18F15Q41

Posted: Tue Sep 30, 2025 10:16 am
by medelec35
Hi Dirk
I have just tried the internal EEPROM and no issues with read or write.
Can you just try internal EEPROM with only UART,
then add suspected component that might be causing an issue.
Then you can still see if internal EEPROM is working or not.

Re: PIC18F15Q41

Posted: Mon Oct 20, 2025 5:13 pm
by DirkB
Hi Martin,

The EEPROM component does not write (or read, or both), and the MIDI component does not work. The timing problem is definitely due to the I2C component. Perhaps an (i2c)-interrupt problem? If there is no I2C component such as serial EEPROM, I2C DAC, or I2C DIGIPOT, the speed of the program seems to be correct.

regards
Dirk

Re: PIC18F15Q41

Posted: Tue Oct 21, 2025 8:59 am
by DirkB
Hi Martin Hi Ben,

sorry, the internal EPROM seems to be working. I forgot to reactivate the address description. The timing problem is really the
I2C component. Midi isn't working either. I activated a Midi send function, and something is being sent. But the receiver isn't responding. Seems to be the wrong baud rate. I added a flashing function with an LED. But it flashes at a completely random speed, even though all I2C components have been completely removed. I hope that helps.

Dirk

Re: PIC18F15Q41

Posted: Tue Oct 21, 2025 10:17 am
by medelec35
Hi Dirk.
When I tested the osc frequency, I set the microcontroller to internal 64MHz.
Used a logic analyser to measure the pulse of 10ms on, 10ms off..... etc.
It was very stable and spot on.
UART and timer interrupts are spot on as well.
How have you got your setup, internal/external osc etc?

You should make sure the speed is stable before trying UART and other timed related components.

Re: PIC18F15Q41

Posted: Tue Oct 21, 2025 4:14 pm
by DirkB
internal osc 64Mhz
It seems that the LUT component is not working either. Instead of a sine wave, it produces a random output. An up-down counter produces a triangular signal at the output of the PWM.