I've been trying this for a few hours but no luck. I'm using wireless communication and sending 18 separate bytes of data is an issue because the packet is so long. As I shorten it the reliability goes up. Anyhow, I have the following on the TX side (16F876):
b1=PORTA.5 'PIN 1
B2=PORTA.2 'PIN 2
b3=PORTA.1 'PIN 3
b4=PORTA.0 'PIN 4
b5=PORTB.1 'PIN 5
B6=PORTB.5 'PIN 6
b7=PORTB.4 'PIN 7
b8=PORTB.2 'PIN 8
b9=PORTC.0 'PIN 9
B10=PORTC.1' PIN 10
b11=PORTC.2 'PIN 11
b12=PORTC.3 'PIN 12
B13=PORTC.7 'PIN 13
B14=PORTC.5 'PIN 14
b15=PORTC.4 'PIN 15
b16=PORTB.0 'PIN 16
The variables above are switches. When I get ready to send the data, I send out this packet:
HSEROUT [start,b1,b2,b3,b4,B5,b6,B7,B8,B9,B10,B11,B12,B13,B 14,B15,B16,sum.byte0]
On the RX side, the incoming message is decoded like this:
HSERIN 30, xfer, [start, IN1, IN2, IN3, IN4,IN5,in6, in7, IN8, IN9, IN10, IN11, IN12, IN13, IN14, IN15, IN16 ,sum]
My laymans approach would be to do this:
HSEROUT [START, B1, SUM.BYTE0]
B1 could be 17 as an example. On the incoming message, the LED's would light like this:
1000100000000000
Can something like this be done?
Bookmarks