Announcement

Collapse
No announcement yet.

Serial Port on 12F1822

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serial Port on 12F1822

    I'm not familiar with how to do this. Are there any tutorials that can get me started?

  • #2
    There are typically 3 forms of serial communication; SPI, I2C, and USART. Just knowing what's available may help you narrow down what you need. I never worked with I2C. SPI is nice when you have more than one "Slave" on the "Network". USART is nice because you can send & receive in the background with hardware. What are you building?
    We can crack this cotton PIC'n thang!

    Comment


    • #3
      Thanks for the reply.

      I'm using SPI with PBP3. I'm trying to make a device to read RFID tags and turn a relay on. I have the connections to the RFID-RC522 reader/ writer figured out. I can see that I need to set the registers on the pic to assign the pins to SPI. The PIC would be in master mode and I believe I understand how to send the rfid data. I can't find enough resources to tell me if the reader will just send the data that's on a tag without prompting? Will it send some kind of signal that a valid tag is in range and I have to send commands to read the tag, etc.? If the PIC is master mode and it controls the clock for the slave to read data in then how does the master read data back from the slave? Is it handled seamlessly through PBP3? Do I continuously poll the register for incoming data or do I use an interrupt?

      I don't want to post a million questions here and so far it's taken about 10 resources to get me where I am now. So I'm looking for tutorial that will answer these kinds of questions and I can't seem to find anything comprehensive.

      Comment


      • #4
        Part of your answer is to be found in the data sheet for the RFID. Can't help you there. However, SPI is covered in the PBP3 Manual under the following commands:
        SERIN
        DEBUGIN
        SERIN2
        HSERIN
        SEROUT
        DEBUG
        SEROUT2
        HSEROUT

        Reading those sections may zero your efforts in where you are trying to be. Furthermore, there are MicroChip Application Notes on the subject for a more mechanical overview (go to the MicroChip.com web site and use their search engine). I find mentors help me the most when they are able to direct me where to find my answers more than when they give me the answers (which may or may not fix my issue).
        We can crack this cotton PIC'n thang!

        Comment


        • #5
          Yes I'd rather be pointed to some well written material I can research. I think I'm understanding the PIC side of it and I have the RFID datasheet for the chip but the chip is actually on a card that has some other functions and I can't find any good resources for that. Thanks for the help.

          Comment

          Working...
          X