Page 1 of 1
Programming PIC12F508/12F675 microcontrollers using Mickro C
Posted: Fri Jul 25, 2014 3:56 pm
by Kriz
Hi Friends,
Does any one program PIC12F508/12F675 micro controllers using Mikro C (product of MikroElektronika) ?.
it's really appreciate if any one can guide me .
thanks. :
Re: Programming PIC12F508/12F675 microcontrollers using Mickro C
Posted: Tue Jul 29, 2014 1:45 am
by Neo
I did PICs with HI-TECH C which is very good compiler suite for MPLab. If you can describe your problem, will try to help you.
Re: Programming PIC12F508/12F675 microcontrollers using Mickro C
Posted: Tue Jul 29, 2014 5:08 pm
by Kriz
actually I wanted to generate some LED light patterns.if you can explain the logic then i will able to try . then i ask if there are any issues.
thanks a lot.
Re: Programming PIC12F508/12F675 microcontrollers using Mickro C
Posted: Sat Aug 02, 2014 2:59 pm
by Neo
This tutorial will help to get you started...
https://robot.lk/viewtopic.php?f=18&t=1587
Re: Programming PIC12F508/12F675 microcontrollers using Mickro C
Posted: Thu Aug 07, 2014 2:32 pm
by Kriz
I've managed to do it for the both PIC12F508 ,PIC12F675 micro-controllers .here is the code for "Budu Rasmala"
here it is .hope this will help to others also.and thank you! very much NEO.
Code: Select all
/ * Coded By Kriz
* Created: Sun Aug 3 2014
* Processor: PIC12C508A
* Compiler: HI-TECH C for PIC10/12/16
*/
#include <htc.h>
#define _XTAL_FREQ 4000000
int a= 8;
int b= 8;
int c= 8;
int d= 8;
int e= 8;
int h= 1;
void main(void)
{
TRISGPIO = 0;
while(h) /*main loop*/
{
while (a>0)
{
GPIO=0x01;
__delay_ms(250);
GPIO=0x02;
__delay_ms(250);
GPIO=0x10;
__delay_ms(250);
GPIO=0x20;
__delay_ms(250);
GPIO=0x00;
__delay_ms(100);
a--;
}
while (b>0)
{
GPIO=0x33;
__delay_ms(250);
GPIO=0x32;
__delay_ms(250);
GPIO=0x30;
__delay_ms(250);
GPIO=0x20;
__delay_ms(250);
GPIO=0x00;
__delay_ms(100);
b--;
}
while (c>0)
{
GPIO=0x22;
__delay_ms(250);
GPIO=0x11;
__delay_ms(250);
GPIO=0x00;
__delay_ms(50);
c--;
}
while (d>0)
{
GPIO=0x33;
__delay_ms(250);
GPIO=0x32;
__delay_ms(250);
GPIO=0x31;
__delay_ms(250);
GPIO=0x23;
__delay_ms(250);
GPIO=0x13;
__delay_ms(250);
GPIO=0x00;
__delay_ms(10);
d--;
}
while (e>0)
{
GPIO=0x33;
__delay_ms(250);
GPIO=0x00;
__delay_ms(250);
e--;
}
h++;
}
}