I need a little refresher on how to calculate the SHIFTOUT statement. and please explain in English, the way that innovationfirst and FIRST explain is a tad bit tooo confusing. so if anyone could help that would be great. thankx and have a great day. later days
You should never have to play with those statements.
What you do need to do, is go to the section “DEFINE CONSTANTS FOR INITIALIZATION” and set the constants for the variables you are INPUTING to 1.
Then, just set up your serin statement so that it inputs those variables. Look at the sample serin statement for the order of the variables you choose.
Example:
c_p1_y, c_p2_y, c_p3_y, c_p3_x, c_oi_swA, c_oi_swB, c_sensor1, c_rc_swA, c_rc_swB, and c_PB_mode are all set to 1. The serin statement would look like:
I guess my question is this:
Are you sure you need synchronus serial communication? I can only assume that if you truly do, then you are using an external circuit that has a need for a clock. If this is not the case, then you want serout. Otherwise, here is shiftout:
shiftout Dpin,Cpin,Mode[data{\bits},…]
This means that you will have three constants: Dpin, Cpin, and Mode. Dpin is going to be the data line, 16 if your going to use the program port. CPin is the pin where you will connect the clock on your device. I actually have no idea how to do this on an IFI system, only on a breadboard-stamp. Mode must be matched depending on the protocol of the device that you are using. Since it is a constant from 0-3, it won’t be too painful to find out by trial-and-error. Then, you put your data. It will, by default, output 8 bits for every value, but you can change this with the optional operand {\bits}. This, once again, depends on the protocol of your device.
Good luck with this, becuase I would not want to try and figure all this out in the last week!