caramoan tour package

caramoan tour package

Author Topic: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle  (Read 13609 times)

Offline Shey

  • Administrator
  • Gas Turbine
  • *****
  • Posts: 2004
  • Pogi/Ganda Points: 154
  • Gender: Female
  • "E tangi ana koe Hine e hine, E hine e Hoki maira"
    • Elab.PH
Free online E-book on MikroC programming..

http://www.mikroe.com/en/books/pic-books/mikroc/ch1/#intro

Table of Contents

Chapter 1: World of Microcontrollers
1.1 Introduction
1.2 NUMBERS, NUMBERS, NUMBERS...
1.3 MUST KNOW DETAILS
1.4 PIC MICROCONTROLLERS
Chapter 2: Programming Microcontrollers
2.1 PROGRAMMING LANGUAGES
2.2 THE BASICS OF C PROGRAMMING LANGUAGE
2.3 COMPILER MIKROC PRO FOR PIC

Chapter 3: PIC16F887 Microcontroller
3.1 THE PIC16F887 BASIC FEATURES
3.2 CORE SFRS
3.3 INPUT/OUTPUT PORTS
3.4 TIMER TMR0
3.5 TIMER TMR1
3.6 TIMER TMR2
3.7 CCP MODULES
3.8 SERIAL COMMUNICATION MODULES
3.9 ANALOG MODULES
3.10 CLOCK OSCILLATOR
3.11 EEPROM MEMORY
3.12 RESET! BLACK-OUT, BROWN-OUT OR NOISES?

Chapter 4: Examples
4.1 BASIC CONNECTING
4.2 ADDITIONAL COMPONENTS
4.3 EXAMPLE 1 - Writing header, configuring I/O pins, using delay function and switch operator
4.4 EXAMPLE 2 - Using assembly instructions and internal oscillator LFINTOSC...
4.5 EXAMPLE 3 - TMR0 as a counter, declaring new variables, enumerated constants, using relay ...
4.6 EXAMPLE 4 - Using timers TMR0, TMR1 and TMR2. Using interrupts, declaring new function...
4.7 EXAMPLE 5 - Using watch-dog timer
4.8 EXAMPLE 6 - Module CCP1 as PWM signal generator
4.9 EXAMPLE 7 - Using A/D converter
4.10 EXAMPLE 8 - Using EEPROM Memory
4.11 EXAMPLE 9 - Two-digit LED counter, multiplexing
4.12 EXAMPLE 10 - Using LCD display
4.13 EXAMPLE 11 - RS232 serial communication
4.14 EXAMPLE 12 - Temperature measurement using DS1820 sensor. Use of 1-wire protocol...
4.15 EXAMPLE 13 - Sound generation, sound library...
4.16 EXAMPLE 14 - Using graphic LCD display
4.17 EXAMPLE 15 - Using touch panel...

Appendix A: It's Time for Fun
A.1 LET'S BEGIN...
A.2 PROGRAM COMPILATION
A.3 IS THIS A HAPPY ENDING?
A.4 DEVELOPMENT SYSTEMS
I wish for this night-time to last for a lifetime
The darkness around me
Shores of a solar sea
Oh how I wish to go down with the sun
Sleeping
Weeping
With you

I walk alone
Every step I take
I walk alone
My winter storm
Holding me awake
It’s never gone

I fear that soon you'll reveal
Your dangerous mind
As your true colours show
A dangerous sign

Philippine Electronics Forum


Offline alexdlsan

  • LR44 Battery
  • *
  • Posts: 1
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #1 on: January 30, 2010, 08:52:25 PM »
I need someone who could help me design a digital led clock with date with auto sync via rs485 from a pc or master..using a microcontroller. anyone interested please email me at alexdlsan@yahoo.com......thanks

Philippine Electronics Forum

Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #1 on: January 30, 2010, 08:52:25 PM »

Offline doyverine

  • LR44 Battery
  • *
  • Posts: 3
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #2 on: November 19, 2010, 02:57:47 AM »
magandang araw sa inyo engineers again.....

tulungan niyo po ako sa Microcontroller/Microprocessor ko...

project po namin ay ROBOTIC ARM...

ma-simple circuit man na robotic arm o hindi try po namin gawin ^_^

pwede niyo bah mas-share ang link sa ROBOTIC ARM?

ito po account ko sa YM... obetdoie11@yahoo.com or post lang po dito na threads ang link sa ROBOTIC ARM....

maraming salamat po!

pagpalain kayo ni hesus!

more power electronicslab.ph!

Philippine Electronics Forum

Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #2 on: November 19, 2010, 02:57:47 AM »

Offline purpledee

  • Size AAA Battery
  • ***
  • Posts: 86
  • Pogi/Ganda Points: 1
  • Gender: Female
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #3 on: December 01, 2010, 10:26:52 PM »
just wondering po.. ano po ba ang pagkakaiba-iba ng hi-tech c, css c, proton c, mikroc when it comes to creating a program for pic?

Philippine Electronics Forum

Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #3 on: December 01, 2010, 10:26:52 PM »

Offline RiDdLeR???

  • Hydroelectric
  • ***
  • Posts: 3032
  • Pogi/Ganda Points: 208
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #4 on: December 01, 2010, 11:10:13 PM »
just wondering po.. ano po ba ang pagkakaiba-iba ng hi-tech c, css c, proton c, mikroc when it comes to creating a program for pic?
Basically the expected outputs will be or should be the same.  The difference is how each compiler implements certain c instructions and pic specific  functions to achieve the common output.   Sometimes, automated or intrinsic instructions can be performed by one compiler but not by another.

Take the case for bank selection.  In both hitech c and ccsc, bank selection is automatically done by the compiler when accessing ram data stored in different banks.  This is transparent.  For the case of mikro c, for the pic 16 series, the compiler does not do this automatically, you have to manually set the bank select bits.

Philippine Electronics Forum

Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #4 on: December 01, 2010, 11:10:13 PM »

Offline simplymoody

  • CR2032 Battery
  • **
  • Posts: 12
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #5 on: January 01, 2011, 05:44:35 AM »
halu..

about this:
For the case of mikro c, for the pic 16 series, the compiler does not do this automatically, you have to manually set the bank select bits.

mikro c po kasi gamit ko for pic16.. uhm, hindi ko lang po sure pero sa iilang program po na nagawa ko, never ko pa po manually s-in-et yung bank select bits. though working naman po yung programs ko.. i wonder kung meron lang talagang versions na hindi pa automatic yung pagseselect ng bank.. i guess yung version na gamit ko, automatic na din.. ???

Offline RiDdLeR???

  • Hydroelectric
  • ***
  • Posts: 3032
  • Pogi/Ganda Points: 208
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #6 on: January 01, 2011, 08:04:14 AM »
halu..

about this:
mikro c po kasi gamit ko for pic16.. uhm, hindi ko lang po sure pero sa iilang program po na nagawa ko, never ko pa po manually s-in-et yung bank select bits. though working naman po yung programs ko.. i wonder kung meron lang talagang versions na hindi pa automatic yung pagseselect ng bank.. i guess yung version na gamit ko, automatic na din.. ???
MikroC can only access banks 0 and 1 automatically.  If your program uses 129 bytes or more of RAM, it will need to access banks 2 ( and bank 3).  This is the hassle with MikroC, you will get a warning regarding IRP bits (bank select bits) must be manually set.   Sometimes a lot of unknown variables specially the ones used by library functions will cause this warning if all the ram locations in bank 0 and bank 1 are used up.  Then you are forced to manually locate your own declared ram variables on bank 2 and bank 3 to make room for the ram used by the  library function which are automatically set to use banks 0 and banks 1 only.  This is the hassle in coding as each time you need to call your function or variables, you must manually set the IRP bank select bits.

I started learning on MikroC and when I encountered that limitation I switched to Hitech C.  In MikroC, you cannot directly compare ROM and RAM variables ... you have to manually copy rom variables into RAM and do a RAM to RAM comparison.

Offline simplymoody

  • CR2032 Battery
  • **
  • Posts: 12
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #7 on: January 01, 2011, 08:55:27 AM »
ooooh.. yun pala pagkakaiba :) hindi ko pa po kasi ako umaabot sa ganung scenario. thank you for the info. :)
happy new year :)

Offline xperryment

  • Size AAA Battery
  • ***
  • Posts: 65
  • Pogi/Ganda Points: 1
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #8 on: January 25, 2011, 10:42:19 AM »
anu pong programmer ang pde s MikroC???????? penge naman po ng circuit

Offline simplymoody

  • CR2032 Battery
  • **
  • Posts: 12
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #9 on: March 24, 2011, 11:26:05 AM »
MikroC can only access banks 0 and 1 automatically.  If your program uses 129 bytes or more of RAM, it will need to access banks 2 ( and bank 3).  This is the hassle with MikroC, you will get a warning regarding IRP bits (bank select bits) must be manually set.   Sometimes a lot of unknown variables specially the ones used by library functions will cause this warning if all the ram locations in bank 0 and bank 1 are used up.  Then you are forced to manually locate your own declared ram variables on bank 2 and bank 3 to make room for the ram used by the  library function which are automatically set to use banks 0 and banks 1 only.  This is the hassle in coding as each time you need to call your function or variables, you must manually set the IRP bank select bits.

I started learning on MikroC and when I encountered that limitation I switched to Hitech C.  In MikroC, you cannot directly compare ROM and RAM variables ... you have to manually copy rom variables into RAM and do a RAM to RAM comparison.

now i know what you are saying sir. kakaexperience ko lang po nito. i was using hitech c before kaso my code is so messed up lalo na yung sa LCD part ko so i switched to mikroc for convenience. yun pala, mas pahihirapan pa ako. haay.

Offline janjan17

  • LR44 Battery
  • *
  • Posts: 1
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #10 on: June 14, 2011, 10:14:56 PM »
hi, gusto ko lang pong malaman kung anu po ba ung common language na ginagamit sa pagpoprogram ng microcontroller? dalawa lang po ung binigay sa min nung instructor nmin Assembly language & Visual basics.... thanks ..ECE student po ako 4th yr tinitake ko kasi ngaun ung Microprocessors..

Offline Macgyver

  • Diesel Generator
  • *
  • Posts: 1440
  • Pogi/Ganda Points: 70
    • MakerDude
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #11 on: June 14, 2011, 10:35:17 PM »
pinaka common is C
Become a Virtual Worker |  MakerDude.com Electronics Shop is now OPEN!

Offline crisostomolito

  • Size AAA Battery
  • ***
  • Posts: 59
  • Pogi/Ganda Points: 0
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #12 on: July 01, 2011, 03:34:13 PM »
Subs
Give me a place to stand and i shall tilt the earth.

Offline marsianpipz

  • Size D Battery
  • ******
  • Posts: 251
  • Pogi/Ganda Points: 10
  • Gender: Male
  • life is so amazing :D
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #13 on: August 05, 2011, 02:26:44 PM »
im using pic16F628A meroon po ba ditong circuit pra sa training board at downloader medyo nhhrpn po kxe ako mag eagle cad :D
"   Life doesn't get easier, you just get stronger.              "

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #14 on: August 05, 2011, 06:40:04 PM »
im using pic16F628A meroon po ba ditong circuit pra sa training board at downloader medyo nhhrpn po kxe ako mag eagle cad :D

Ito sana sir:
http://www.olimex.com/dev/pdf/pic-pg4d.PDF
Meron ng programmer at serial interfacing using TTL. Kaso lng walang PCB layout.
Sir taga Cebu ka ba?

MikroC can only access banks 0 and 1 automatically.  If your program uses 129 bytes or more of RAM, it will need to access banks 2 ( and bank 3).  This is the hassle with MikroC, you will get a warning regarding IRP bits (bank select bits) must be manually set.   Sometimes a lot of unknown variables specially the ones used by library functions will cause this warning if all the ram locations in bank 0 and bank 1 are used up.  Then you are forced to manually locate your own declared ram variables on bank 2 and bank 3 to make room for the ram used by the  library function which are automatically set to use banks 0 and banks 1 only.  This is the hassle in coding as each time you need to call your function or variables, you must manually set the IRP bank select bits.


Na experience ko din ito noong gumagami ako ng LCD using PIC887. Dami ako na i-save na mga phrases, na ubos na tuloy ang rom or ram sa bank 0 at lumabas na yung "IRP bits (bank select bits) must be manually set". Hanggang ngayun hindi ko alam ang solution. I am thinking to shift to Hitech C or Pic18 nalang.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline o0oyaskaio0o

  • CR2032 Battery
  • **
  • Posts: 49
  • Pogi/Ganda Points: 1
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #15 on: September 09, 2011, 07:58:53 PM »
thanks po sa mga info. :D

Offline clare

  • Size C Battery
  • *****
  • Posts: 187
  • Pogi/Ganda Points: 3
  • Gender: Female
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #16 on: September 23, 2011, 08:20:31 PM »
how to acces banks 2 and 3 using mikroc? ^_^ do i need to input some codes?
see the opportunity in every difficulty,  not see  difficulty in every opprtunity

Offline RiDdLeR???

  • Hydroelectric
  • ***
  • Posts: 3032
  • Pogi/Ganda Points: 208
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #17 on: September 23, 2011, 08:34:04 PM »
Locate all your user ram variables to bank 2 and 3 using the "absolute" keyword because all the ram variables used by the libraries can only be automatically located in banks 0 & 1.

To switch to bank 2 & 3, set IRP bit to 1.  To return to bank 0 & 1, set IRP bit to 0.   

Offline clare

  • Size C Battery
  • *****
  • Posts: 187
  • Pogi/Ganda Points: 3
  • Gender: Female
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #18 on: September 29, 2011, 02:20:58 PM »
thanks! :)   what is the major difference in mikroC ang mikroc PRO? which is better? is there some codes not applicable to the other?
see the opportunity in every difficulty,  not see  difficulty in every opprtunity

Offline zrehtiek/keitherz

  • Lead Acid Battery
  • *******
  • Posts: 772
  • Pogi/Ganda Points: 45
  • Gender: Male
  • PhilRoboKit Anito
Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #19 on: September 29, 2011, 02:24:05 PM »
code size limited ang hindi PRO

Philippine Electronics Forum

Re: PIC Microcontrollers Tutorial - Programming in MikroC by Milan Verle
« Reply #19 on: September 29, 2011, 02:24:05 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com