Page 1 of 1

MikroC Support 16F18425

Posted: 16 Mar 2022 14:01
by robertj
Is there any plans to add support for the 16F18425 in MikroC Pro. Is there a DEF file for another PIC that is similar enough that it might work with this chip? I have MikroC Pro V7.6 which I believe is the latest as of 3/16/22

Thanks for the help

Re: MikroC Support 16F18425

Posted: 25 Mar 2022 10:15
by filip
Hi,

Since this MCU is not supported, I'm not sure if any def file would be appropriate I'm afraid.

Regards,
Filip.

Re: MikroC Support 16F18425

Posted: 11 Apr 2022 18:03
by robertj
We have redesigned our circuit with a 16F18325. We needed a PIC with two I2C modules. One to be a slave and report data back to a controller and one to be a master and read a sensor. The master part works OK but the slave won't respond to the address we assign. We put a marker into the program and discovered the chip is seeing the address and going into the interrupt routine but we get no output. The masted just times out.

Is there a slave library available.
Is there some example code geared to the 16F18325 for I2C1 slave?

Here is the initialization and my code as simple as I can make it. I should get clock pulses that clock out SP1BUFF.


void interrupt() // I2C slave interrupt handler
{
if (PIR1.SSP1IF == 1) // I2C Interrupt
{
PIR1.SSP1IF = 0;// reset SSP interrupt flag

//transmit data to master
if(SSP1STAT.b2 == 1) // READ/_WRITE I2C SLAVE READ?

{
SSP1BUF = 200;// Get data to send
SSP1CON1.B4 = 1 ;// CKP Release SCL line
j = SSP1BUF; // That's it


porta.b4 = 0;
porta.b4 = 1; //marker pulse
porta.b4 = 0;


return;
}


void main()
{
OSCCON1 = 0b00000001; //Set clock to internal PLL 16 mhz
TRISA = 0b11101111; // RA 4 becomes output
TRISC = 0b00110011; //I2C1=RC0,RC1 I2C2=RC4,RC5
ANSELA = 0b00000000; //Disable other modules Port A
ANSELC = 0b00000000; //Disable other modules Port C
PMD4 = 0b00100000;
SSP1ADD = Addy;
PIE1.B3 = 1; // SSP1IE Enables the MSSP interrupt
INTCON = 0b11000000;
SSP1STAT = 0b0000000;
SSP1CON1 = 0b00110110;
SSP1CON2 = 0b10110000;
SSP1CON3 = 0b00000010;

Re: MikroC Support 16F18425

Posted: 14 Apr 2022 12:43
by filip