PIC-control sense and read IR signal

Discussion in 'Embedded Systems and Microcontrollers' started by alicia, Oct 25, 2008.

  1. alicia

    Thread Starter Member

    Oct 6, 2008
    10
    0
    Hi, i'm totally new to PIC. I start to learn it for my project. I would need some helps, below is some parts of my coding:

    movlw D'4'
    movwf J
    movwf K

    dec:
    decfsz J,f
    goto readbit
    goto led_off

    readbit:
    btfsc PORTA,J
    goto loop2
    goto dec

    What i want to ask is that could i actually compare the signal from port with the J that i have decrease as 'btfsc PORTA,J'?

    I try to simulate but the result is different so i wonder where i have make mistake or what i have not consider into my coding.

    Really need help asap!!! Thanks!!!
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    It would be essential to know about the IR end of things. What does your hardware and I/F look like?
     
  3. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    In short, no. btfsc needs two parameters, the first is register file address and the second is a literal between 0 to 7 (3 bits).

    The btfsc PORTA, J command might actually be interpreted as test the bit number indexed by the least significant 3 bits of J register file address of PORTA instead of the bit number indexed by the value of J register file.
     
  4. alicia

    Thread Starter Member

    Oct 6, 2008
    10
    0
    i got a few questions and hope to get reply for my questions.
    if i put portb as input and i have the following commands:

    movf rowMask,w
    andwf keyMask,f
    movf keyMask,w
    movwf PORTB

    what i want to ask is whether the command 'movwf PORTB' going to move the previous stored w from the command ' movf keyMask,w' to PORTB or it is going to store what is from the input?
     
  5. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    It moves the content of W register to PORTB.
     
  6. alicia

    Thread Starter Member

    Oct 6, 2008
    10
    0
    thx to ur help!!!!!
     
  7. alicia

    Thread Starter Member

    Oct 6, 2008
    10
    0
    Hi hi,
    How to interface the PIC to the webs and sending email?
    Help is appreciated!!!
     
  8. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    I think that takes more ability than a PIC has got. Does yours (model so far unstated) have a built-in ethernet interface?
     
  9. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    Depending on the model. On the software side, Microchip offers a free TCP/IP stack. On the hardware side, there is at least one PIC18 part with internal ethernet MAC + Phy. Microchip also has a separate MAC + Phy with serial interface.

    Other route is to use external MAC + Phy, there are many of them available. Popular ones for interfacing to microcontroller includes CS8900 (Crystal Semi) and RTL8019 (Realtek). There are many development boards or 'headers' available for these with reasonable prices.
     
  10. alicia

    Thread Starter Member

    Oct 6, 2008
    10
    0
    My whole project is to detect documents in pigeonholes and notify the user when documents available using email. I now doing the interfacing part and i found one similar project but they are using php, apache and MySQL, another new things to me, so are there any other methods and references for me to refer? Any recommended website? I need to explore myself more... thanks!!!
     
  11. alicia

    Thread Starter Member

    Oct 6, 2008
    10
    0
    Anyone can give me opinion on my previous question???
    Hope to hear from anyone soon!!!
    Appreciate all your help!!!
     
Loading...