PIC16f876A coding using Mikro C

Discussion in 'Embedded Systems and Microcontrollers' started by ieda, Oct 14, 2008.

  1. ieda

    Thread Starter New Member

    Oct 14, 2008
    Hi! newbie here...now i'm doing project titled: heart rate monitoring and alarm system for athletes..

    Sensor(electrode pad) will be connected to the display part (PIC Microcontroller + LCD) and to alarm system. The alarm will be activate when the heart beat exceed the max heart rate for athlete...

    Sensor -> Microcontroller+LCD--> Alarm system

    my problem is, i'm not familiar with Microcontroller... i dun know how to make coding for both PIC 16F876A(using Mikro C software) and LCD......

    I dun know how to start...

    Can someone help and guide me....
  2. CVMichael

    Senior Member

    Aug 3, 2007
    Well, first things first... is the microcontroller connected to everything ?

    What I mean is, did you finish the hardware part ?

    Also, is your LCD listed in the help file from MikroC ? Because there are many built-in functions for diferent LCDs, if your LCD is not listed then you have to write your own functions to control the LCD.

    Also, do you have the full version of he MikroC ? (because you most likely won't be able to do it with the demo version, because of it's 2K output limitation)
  3. boff1


    Oct 15, 2008
    Hi there,
    Suggest you start here. Also have a look at some of the examples that are given in the manual and the help files. The 16f876A should be well documented and other programs can be adjusted to suit by changing the cofiguration setup.Don't worry too much about exceeding the demo limit. You can do a great deal and still be within the limit.
    I use Mikrobasic and rarely exceed the limit. - hate C!

  4. CVMichael

    Senior Member

    Aug 3, 2007
    I wrote a 100-something line program, everything was fine... then I added an extra line using sprintf and it reached the 2K limit...

    I actually wanted to print an integer variable to a string and output throgh RS232.

    Then I wrote my own function to convert int to string about 20 lines more, and used that function instead of sprintf, and everything was fine (no 2k limit)...

    In other words, using built in functions uses a lot of code space, if you write your own functions for everything, then you might get by... but if you don't know how to write your own functions (like controling the LCD as in his case), then I think he will most likely have to buy the software...

    I did... and I think it was worth it, I guess it all depends on how much value $249 is for you, for me it's a day and a half of work, for others it may be a few days of work, and for others it could be a whole month of work...