cts_casemod
Member level 4
- Joined
- Dec 9, 2010
- Messages
- 72
- Helped
- 14
- Reputation
- 28
- Reaction score
- 14
- Trophy points
- 1,288
- Location
- London
- Activity points
- 1,950
I am trying to read 11 bits of data spread over a few different ports on my pic microcontroller, into a single 16bit variable. The code language is ASM.
The uC is 16 bits so no issues with being more than 8 bits wide.
Will this be the right way to archieve what i need?
if not any sugestions?
The uC is 16 bits so no issues with being more than 8 bits wide.
Will this be the right way to archieve what i need?
Code:
#define INPIN1 PORTA,0
#define INPIN2 PORTA,1
#define INPIN3 PORTA,2
#define INPIN4 PORTA,3
#define INPIN5 PORTA,4
#define INPIN6 PORTA,5
#define INPIN7 PORTA,6
#define INPIN8 PORTA,7
#define INPIN9 PORTA,8
#define INPIN10 PORTB,9
#define INPIN0 PORTB,10
CLRF result
btfsc ANYPIN0
bsf result,0
btfsc ANYPIN1
bsf result,1
btfsc ANYPIN2
bsf result,2
btfsc ANYPIN3
bsf result,3
btfsc ANYPIN4
bsf result,4
btfsc ANYPIN5
bsf result,5
btfsc ANYPIN6
bsf result,6
btfsc ANYPIN7
bsf result,7
btfsc ANYPIN8
bsf result,8
btfsc ANYPIN9
bsf result,9
btfsc ANYPIN10
bsf result,10