Serial problem, Does reading and writing i.e opening file from PC constantly re
boonboy
Posts: 10
Hello again guys. Im using fopen and fread to send data to the bs2, fwrite works fine it sends the data to the bs2 and I get a response over debug window. But the bs2 seems to only do this once then not again. It looks like the bstamp is being reset , I read a couple of posts ago about the bs2 being reset on a file open, some line or other being set high and resetting the bs2, could this be my problem. Could I be getting a reply and then my device being reset/wiped so no more writes or reads are available. If this is so is there a buffer where the value sent from my serout could be retrieved and also is there a way to get round this problem.
Comments
1) Use a serial cable or jumper cable or adapter that has DTR disconnected. You use a normal cable/adapter for programming the Stamp.
2) Use another set of pins on the Stamp for your data connection to the PC. The PBasic manual shows how to do this in the section on the SERIN/SEROUT statements. It requires a resistor in series with the serial input line (and I suggest a 470 ohm resistor in series with the serial output line as well in case there's an error in connecting the Stamp or a program bug).
I have a normal straight through cable. If I cut out the DTR pin would it then work for SERIN/SEROUT communication. OR do i have to loop the DTR back on another line in the cable?