Searching \ for '12C' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: '12C'.

Truncated match.
PICList Thread
1999\10\30@102429 by Thomas Wright

part 0 16 bytes

1999\10\31@095718 by Quentin

> Thomas Wright wrote:

>                     movlw        8   ;8 bit count reg
>                     movwf       count
>  testbit_
>                     btfsc
>  gpio,1                                      ;clock pin on eeprom
>                     goto         testbit_
>  ti_
>                     btfss         gpio,1
>                     goto          ti_
                     btfsc       gpio,2
>                     bsf           temp,0
                     bcf       status,c
>                     rlf              temp
>                     decfsz     count
>                     goto         testbit_
Hi Thomas
A quick look at your code. See the changes I made. In your code, when
you found a low on gpio2, you went back to start without shifting the
temp reg.


1999\10\31@192212 by Thomas Wright

Thanks Quentin
but it still wont work
im am using 12508 pic,pin 5 for data pin 6 for clock..

1-- when i use status,c mplab gives error should this be status,0

what i want to do is to look at an 8 bit data word on pin 5  (standerd i2c
bus )
test to see if it is hi or low then, put the same value into the reg i named

i used the adapted code you sent but i still cant get the same value into
temp reg
as i am sending into pin 5 off pic

it looks like my problem is that i am testing for hi,low bit then moving
temp reg to left (rlf)
this i am doing 8 times the last bit test takes me into carry bit of temp
(12c508 has 8 bits in reg and carrybit)
so if first bit was logic 1 then and last bit is logic 0 the code then makes
carry bit 0
so i loose a logic 1 bit,see what i meen??

i have worked this out on paper and i think the 8 bit value left in temp reg
needs to be reversed
this is fine if first data bit is not logic 1,then i DO get the right value

i now the code i am sending to pic is fine(i wrote it for a nother project
and it works fine)

please please help its driving me mad..


1999\11\01@015942 by Quentin
I had a look at my own I2C code and notice I had a similar problem when
I wrote it. I fixed it by using two count registers. The one count does
not allow the register to shift on the last bit. Have a look. It was
written for the 16C54. ('scuse the NOPs, this is Master read code)

Also, I use the PIC headers that come with MPLAB, in it it will show c
equ 0, thus status,c
learn to use the headers, they are handy.


BITIN       MOVLW       0X08
           MOVWF       TEMP
           MOVLW       0X07
           MOVWF       TEMP1
           MOVLW       B'0001'
           TRIS        PORTA
BITIN1      BCF         PORTA,SCL
           BSF         PORTA,SCL
           BTFSC       PORTA,SDA
           GOTO        BITHI
           BCF         I2CIN,0
           GOTO        BITIN2
BITHI       BSF         I2CIN,0
BITIN2      BCF         STATUS,C
           DECFSZ      TEMP1,F
           RLF         I2CIN,F
           DECFSZ      TEMP,F
           GOTO        BITIN1
           BCF         PORTA,SCL
           CALL        SDELAY
           BSF         PORTA,SCL
           BCF         PORTA,SCL
           MOVLW       B'0000'
           TRIS        PORTA
           BCF         PORTA,SDA
           CALL        SDELAY
           RETLW       0

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...