3- Reading a Switch | mikroC Pro for PIC Tutorial

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 68

  • @abhishekkadri8526
    @abhishekkadri8526 8 років тому +5

    Very Good explanation.

  • @georgeluca2158
    @georgeluca2158 10 місяців тому

    very good my fiend, Manuel Mastropietro is your big fan

  • @tota896
    @tota896 9 років тому +7

    Great stuff. Keep it up guys...

  • @Man2Mr
    @Man2Mr 7 років тому +1

    Thanks ...... It's a nice tutorial on how to Read a particular pin.....

    • @StudentCompanion
      @StudentCompanion  7 років тому +1

      +Mantoo Kaibarta thank you for watching our videos and we appreciate your feedback.

  • @edwindodoh164
    @edwindodoh164 6 років тому +1

    Nice tutorials sir... Really appreciate

  • @OnGround1
    @OnGround1 8 років тому +4

    Hi
    Just got Question
    Why you didn't use ATCON1 in the example on your website for PIC18F45K22?
    Both LED connected to AN12 and AN10 Dont we need to turn analog to digital converter off?

    • @StudentCompanion
      @StudentCompanion  8 років тому +3

      +OnGround1 hi. Thanks for watching our videos. I guess you meant ADCON and not ATCON. we should have used the ANSELx to disable the analog functions on these PORTS but in this case it won't make much difference because we have configured our PORTB as output. analog functions work only if a port/pin is configured as input .

    • @StudentCompanion
      @StudentCompanion  8 років тому +4

      +OnGround1 hi. Thanks for watching our videos. I guess you meant ADCON and not ATCON. we should have used the ANSELx to disable the analog functions on these PORTS but in this case it won't make much difference because we have configured our PORTB as output. analog functions work only if a port/pin is configured as input .

    • @OnGround1
      @OnGround1 8 років тому +1

      Sorry its ADCON

    • @StudentCompanion
      @StudentCompanion  8 років тому +1

      +OnGround1 ok. Great!

  • @agehjeremiah
    @agehjeremiah 9 років тому +4

    THIS IS GOOD. THANKS !

  • @marhsall-bw5kv
    @marhsall-bw5kv 9 років тому +4

    is pickit 2 can be used on PIC18F microcontroller?

    • @StudentCompanion
      @StudentCompanion  9 років тому +2

      +marhsall 27777 I am sure it should support them. Check if you are using the latest pickit 2 firmware

    • @marhsall-bw5kv
      @marhsall-bw5kv 9 років тому +2

      thank you..I found that MikroC is easier than MPLAB..am I right?

    • @StudentCompanion
      @StudentCompanion  9 років тому +2

      +marhsall 27777 Yeah mikroC is much easier, it has also its programmer, mikroProg. It's very easy to use.

  • @mohmedabdelwahab9837
    @mohmedabdelwahab9837 9 років тому +4

    thank you for the tutorial .....how can use tags in microc pro?

  • @chetsadawutruangrojn1554
    @chetsadawutruangrojn1554 8 років тому +1

    Hey could you please tell me that do I need to set something up before I write the code after void main. Thank you.

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      HI. Can you be more specific, your question is not clear. What do you want to set up?
      Have you watched tutorial 1: ua-cam.com/video/jQ8ddVYNlKU/v-deo.html
      It shows you step by step how to set up and and write code for a simple project.

    • @chetsadawutruangrojn1554
      @chetsadawutruangrojn1554 8 років тому +1

      Student Companion SA thanks for quick reply. I try to use pic16f6887 as a processor but mikroc doesn't accept porta.a0 and lat command I just wonder why.

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      It depends on how you write your commands. Most PIC16F don't have the LAT register, so you must use the PORT to read and to write. The LAT register is used if you are using a PIC18F
      Write PORTA.B0 or PORTA.F0 for pin RA0. Don't write PORTA.A0 and don't use LAT.

    • @chetsadawutruangrojn1554
      @chetsadawutruangrojn1554 8 років тому +1

      Thank you so much It help alot .

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      +Chetsadawut Ruangrojn you are welcome!

  • @sakibhasan9077
    @sakibhasan9077 6 років тому +1

    thanks a lot for this tutorial.

  • @philipkim3460
    @philipkim3460 8 років тому +1

    Hello, i have a question. Is it okay to just place the switch between the five volts and the pin? If not, how come?
    Thank you!

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      NO. You can't. The pin will be floating. A microcontroller needs to read the exact status of a switch either it's high or low (to ground), that is why a pull-up or pull-down resistor is used. If you don't want to use external resistors, you can activate internal pull-up resistors.

    • @philipkim3460
      @philipkim3460 8 років тому +1

      Student Companion SA thank you!!! This help alot! Love this series, i would be helpless without it!

    • @StudentCompanion
      @StudentCompanion  8 років тому +1

      +Philip Kim thank you. We appreciate your feedback.

  • @sansitaasasekala6543
    @sansitaasasekala6543 7 років тому +1

    HI...the coding that is given on the website..it shows error after build...help me!!!!!

    • @StudentCompanion
      @StudentCompanion  7 років тому +1

      +Sansitaa Sasekala Hi what error are you getting?

    • @sansitaasasekala6543
      @sansitaasasekala6543 7 років тому +1

      It says illegal character

    • @StudentCompanion
      @StudentCompanion  7 років тому +1

      +Sansitaa Sasekala then they must be something else wrong . Can you post your code and the line number of the error message.

  • @clavellerioux1973
    @clavellerioux1973 8 років тому +2

    thank you again

    • @StudentCompanion
      @StudentCompanion  8 років тому +3

      +Clavelle Rioux you are welcome.

    • @StudentCompanion
      @StudentCompanion  8 років тому +3

      +Clavelle Rioux You Are welcome. Thanks for watching our videos.

  • @chetsadawutruangrojn1554
    @chetsadawutruangrojn1554 8 років тому +1

    Hello sir, I want to interface switch button with LCD and LED both by using pic16f877 could you please guide me

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      Hi. What kind of guidance do you need? This video explains how to use a switch and an LED. This one explains how to use the LCD: ua-cam.com/video/_ujw_tuQDTY/v-deo.html
      The only difference with the PIC, instead of using LAT register when you are switching an LED, use the PORT register for PIC16F877 or any PIC16F series.

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      If you don't know hoe to setup your PIC, start with this video: ua-cam.com/video/jQ8ddVYNlKU/v-deo.html

    • @chetsadawutruangrojn1554
      @chetsadawutruangrojn1554 8 років тому +1

      Thank you so much sir. but I have one more question I'm now trying to do same experiment as in the video but I can't compile LATB.B0 = 1; I use the same pic as you so I don't know what is the problem.

    • @StudentCompanion
      @StudentCompanion  8 років тому +2

      +Chetsadawut Ruangrojn if you used same pic then it should compile. Can you post the full error message

    • @chetsadawutruangrojn1554
      @chetsadawutruangrojn1554 8 років тому +1

      It said undeclared indentifier 'LATB' in expression

  • @kevincueva4419
    @kevincueva4419 6 років тому +1

    ACTIVA TODOS LOS SUBTÍTULOS PARA TODOS LOS VIDEOS, MUCHAS GRACIAS!

    • @StudentCompanion
      @StudentCompanion  6 років тому +1

      UA-cam is now auto generating subtitles. Thank you

  • @keshenanaidu7160
    @keshenanaidu7160 9 років тому +2

    Thanks

  • @mohammedaziz2020
    @mohammedaziz2020 7 років тому +1

    sir can i have next part of this tutorial part 4

    • @StudentCompanion
      @StudentCompanion  7 років тому +1

      Hi. What part 4 you are looking for? This video is tutorial 3 and has not part 1, 2 3 or 4.

  • @prasanthkumar2950
    @prasanthkumar2950 6 років тому +1

    Thanks bri

  • @OnGround1
    @OnGround1 8 років тому +4

    Tutorial -4 Please

    • @StudentCompanion
      @StudentCompanion  8 років тому +3

      +OnGround1 thank you for watching our videos. Tutorial 4 is interfacing 7-Segment display. We will upload it soon.

    • @StudentCompanion
      @StudentCompanion  8 років тому +3

      +OnGround1 in the meantime you can read the article on our website: www.studentcompanion.net/en/interfacing-7-segment-display-with-pic-microcontroller-mikroc/

    • @OnGround1
      @OnGround1 8 років тому +3

      Thanks so much

    • @StudentCompanion
      @StudentCompanion  8 років тому +4

      +OnGround1 you are welcome.