PIC-control sense and read IR signal

Thread Starter

alicia

Joined Oct 6, 2008
10
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!!!
 

n9352527

Joined Oct 14, 2005
1,198
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'?
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.
 

Thread Starter

alicia

Joined Oct 6, 2008
10
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?
 

beenthere

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

n9352527

Joined Oct 14, 2005
1,198
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.
 

Thread Starter

alicia

Joined Oct 6, 2008
10
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!!!
 

Thread Starter

alicia

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