Maybe my source code will help. You can get at it from www.nti-solutions.org. There's a lovely set of classes I wrote, which will definitely help you with the algorithm for reading / writing / erase etc. > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Jai Dhar > Sent: 23 July 2002 02:31 > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: PIC programming problems >=20 > Hi, >=20 > Despite all the help received, I'm still having problems.. so I will > explain what I'm EXACTLY doing. >=20 > I start off with almost 0V on the MCLR pin, and all power off. I > then apply +5V to Vdd and +12V to MCLR simultaneously. After that, I > run my program: >=20 > printf("Issuing write command with data\n"); > sendbyte(6,2,fd); > sendbyte(1,0,fd); > sendbyte(8,5,fd); > sendbyte(6,0x28,fd); > sendbyte(1,0,fd); >=20 > printf("Issuing program cycle command\n"); > sendbyte(6,8,fd); >=20 > printf("Issuing read command\n"); > sendbyte(6,4,fd); > sendbyte(1,0,fd); > printf("Reading data now...\n"); > sendbyte(8,0,fd); > sendbyte(6,0,fd); > sendbyte(1,0,fd); >=20 > sendbyte is defined to be a function that sends a certain number of > bits (I know, naming doesn't make sense) that sends x bits of the > number specified in the second param.. and yes, it sends them in > the correct order. So on the reading data part, I send 6 bits of > 0x04 to issue a read command, and then a start bit. And then, I send > out 14 bits of just clocking while reading the pin via parport (the > sendbyte command also reads the status of RB7). And then finally, a > stop bit. The CLK and Data lines are passed through a buffer and > then connected to RB6/RB7, and RB7 also goes to the input of a > buffer, which goes into the status port of the parport so I can read > it easily. So.. what seems wrong? I have a feeling now that it's the > MCLR issue, I'm not sure though. I read the code lowlvl.c, and my > algorithm is exactly the same after the config. data is entered and > the PC is incremented. But this doesn't seem that it should matter > in my simple situation. Ugh.. I'm getting fustrated! >=20 > Help!! >=20 > Thanx all, >=20 > Jai >=20 > -- > http://www.piclist.com hint: The list server can filter out > subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics >=20 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads