MikroC Support 16F18425

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 8-bit PIC MCUs.
Post Reply
Author
Message
robertj
Posts: 11
Joined: 15 Oct 2013 01:36

MikroC Support 16F18425

#1 Post by robertj » 16 Mar 2022 14:01

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

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

Re: MikroC Support 16F18425

#2 Post by filip » 25 Mar 2022 10:15

Hi,

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

Regards,
Filip.

robertj
Posts: 11
Joined: 15 Oct 2013 01:36

Re: MikroC Support 16F18425

#3 Post by robertj » 11 Apr 2022 18:03

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;
Attachments
NO REPLY.jpg
NO REPLY.jpg (37.87 KiB) Viewed 1460 times
SHOULD BE.jpg
SHOULD BE.jpg (38.69 KiB) Viewed 1460 times

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

Re: MikroC Support 16F18425

#4 Post by filip » 14 Apr 2022 12:43


Post Reply

Return to “PIC PRO Compilers”