use timeout of SERIN2 or DEBUGIN... PBP manual.
use timeout of SERIN2 or DEBUGIN... PBP manual.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
ok I have got the pics that I have been waiting for. I have tried one crued method mentions earlier in the this thread. If I had to set up one pic to wait for the command how would I go about that. That is of course using the SEROUT and SERIN command.
This is were it starts to get hairy.
Last edited by Rhatidbwoy; - 30th January 2006 at 22:47.
Hello Rhatidbwoy,
I have a Master board with 20 slaves connected to it. Actually its 20 masters with 1 slave. The 1 board receives data from the various boards to be displayed and printed out on a POS printer. I have a BUSY line that is normally high. When any board has data to send to the display board it takes the busy line to ground for the duration of the transmission. The display board also takes the busy line to ground and holds it there until someone acknowledges the receipt of the alarm message then it releases then busy line so another message can come in. I'm using SERIN2/SEROUT2 on 16F877A's and my display board has an 18F452. The system has been working great. I also have a remote setup that is smaller with 16F872's in the 20 boards and a 16F877A in the display board. It really took a while to get the serial data stuff working reliably but a gentleman by the name of Steven Collins set me in the right direction. I also got some assistance from MElabs.
Main loop monitors several points including:
If BUSY = 0 then GOTO Getdata
Getdata:
PAUSE 5
SERIN2 serpin,36081,300,Main,[Wait ("A"),dec3 B7]
Upon receipt of the 3 character variable B7, the program now goes thru 320 lines of lookup to find a match thengoes to the display and printing routines.
The 300ms wait before going back the Main is because I put a response delay of 10 ms on each card so the each card waits 10ms more than the previous card so the last card (#20) will wait 190ms before sending its data. It's simple but effective!
The project also time stamps the printout, only sounds alarms between 8am and 4:30p Monday thru Friday but always prints. It also prints when the alarm returns to normal. The printer routines use DEBUGOUT.
Hope some of this helps you.
BobK
can not lie. It is confusing as heck. lol. I will have to read and reread to make sense out of it. It is an idea that is trued that was put together to make work. Instead of 20 different input (19 if 1 is to recieve all of this) I have 2. A master and slave which are both important for what I would like for them to do. I will have to try something.
You think it would work if I put the reciever into a continuous loop to recieve. When it finishes its recieving phase could I then AND certain portion of data and if it equals itself then move to the rest of the program. In the sense I have 4 parts. check part 1 AND 2, see if that is equal to the recieve value, part 3, then continue to part 4? Just throwing out ideas.
SERIN2 serpin,36081,300,Main,[Wait ("A"),dec3 B7]
could the line above be explain in a little more detail. I follow to what you are to do, but I just do not understand it. I am trying something on my end with SERIN and SEROUT, but I think that I might have to switch to this SERIN2 and SEROUT2. Might make life easier. Who know.
Hi Rhatidbwoy,
SERIN2 is fully explained on page 132 of the PBP manual. Serpin is the alias I have assigned to PortA.4 which is where the data will be received. 36081 is the mode of communications I am using derived from the Appendix A on page 201. 300 stands for 300ms which is the timeout for a signal to be received. If no data is received within the 300ms then GOTO Main. Wait ("A") tells the system to wait until the character "A" comes in. This is known as a qualifier. The dec3 tells SERIN2 to convert the decimal value in ASCII and store the value in variable B7.
I truely am not an expert like some of the other people on this forum and I am sure that they can give a more thorough explaination, but what I learned here comes from the manual and trying different things.
BobK
ok that is great help. The method that I am coming across to use is the HSER--- command.. The USART on hte device. I think that will clarify more to what I need to do, but still the problem with transmitting. I found info about that and it helps more than were I stand.
Bookmarks