PIC18F15Q41

For general Flowcode discussion that does not belong in the other sections.
BenR
Matrix Staff
Posts: 1989
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 523 times
Been thanked: 710 times

Re: PIC18F15Q41

Post by BenR »

Hi Dirk,

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

DirkB
Posts: 97
Joined: Thu Dec 10, 2020 3:55 pm
Has thanked: 1 time
Been thanked: 4 times

Re: PIC18F15Q41

Post 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

DirkB
Posts: 97
Joined: Thu Dec 10, 2020 3:55 pm
Has thanked: 1 time
Been thanked: 4 times

Re: PIC18F15Q41

Post by DirkB »

OK, the OSC speed feels like 1/100 or less.

DirkB
Posts: 97
Joined: Thu Dec 10, 2020 3:55 pm
Has thanked: 1 time
Been thanked: 4 times

Re: PIC18F15Q41

Post 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

medelec35
Matrix Staff
Posts: 2177
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 662 times
Been thanked: 736 times

Re: PIC18F15Q41

Post 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.
Martin

DirkB
Posts: 97
Joined: Thu Dec 10, 2020 3:55 pm
Has thanked: 1 time
Been thanked: 4 times

Re: PIC18F15Q41

Post 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

DirkB
Posts: 97
Joined: Thu Dec 10, 2020 3:55 pm
Has thanked: 1 time
Been thanked: 4 times

Re: PIC18F15Q41

Post 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

medelec35
Matrix Staff
Posts: 2177
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 662 times
Been thanked: 736 times

Re: PIC18F15Q41

Post 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.
Martin

DirkB
Posts: 97
Joined: Thu Dec 10, 2020 3:55 pm
Has thanked: 1 time
Been thanked: 4 times

Re: PIC18F15Q41

Post 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.

Post Reply