OK, let me get this straight. You want your program to do the following:
check if portb.0 is high, if so set porta.0 high and so on?
If that's the case, then it's pretty easy,
IF PORTB.0 = 1
THEN PORTA.0 = 1
ELSE PORTA.0 = 0
IF PORTB.1 = 1
THEN PORTA.1 = 1
ELSE PORTA.1 = 0
IF PORTB.2 = 1
THEN PORTA.2 = 1
ELSE PORTA.2 = 0
IF PORTB.3 = 1
THEN PORTA.3 = 1
ELSE PORTA.3 = 0
That is the bulk of what I think you are trying to do. You will have to set the TRISB registers to outputs. In addition, I don't know how fast you would want these changes to occur, so I would see if you could get something like this up and running and check to see if the speed meets your requirements.
Bookmarks