Rusttree said:The 14 bits are padded on either side, making the whole "word" 16 bits long. According to the prog spec, after issuing a Read Data or Load Data command, the clock is cycled 16 times, with the first and last bits being "start" and "stop" bits.
I noticed that when reading a word in memory, the PIC always throws a "1" as the 1st bit and another "1" as the 16th bit. The 14-bit word I programmed is between those two 1's. When the MSB of my 14-bit word is a "0", it doesn't throw the "1" as the 16th bit. And everything after that fails to read.
I did confirm that the PIC is being programmed correctly by incrementing passed the troublesome word and continuing to read.
If it's any help?, here's the routine from WinPicProg that writes 14 bits out, notice that I don't consider it a 16 bit word, but just send clock pulses before and after.
Code:
Procedure OutWord(Data : Word);
Var
x,
BitPos : Word;
Begin
ClockPulse(DLow);
BitPos := 1;
For x := 0 To 13 Do
Begin
IF (Data AND BitPos) = BitPos THEN
ClockPulse(DHigh)
ELSE
ClockPulse(DLow);
BitPos := BitPos Shl 1;
End;
ClockPulse(DLow);
End;