Shop OBEX P1 Docs P2 Docs Learn Events
SPI SOLVED - Page 3 — Parallax Forums

SPI SOLVED

1356711

Comments

  • Lets start with your program Test 2b1, I see you changed the pins to 25 and 24. That's OK, the program is expecting to see data from pins 25 and 24, and its looking for those Getlong variables from another tramsmitting source. (Prop)You will not see anything on your Parallax serial terminal beacause that's on Pin's 30 and 31. You can run both you'll just have to serial start 24 and 25, run some lines of code and then ser.stop. After that ser.start 30 and 31 run your code then ser.stop.
    Test 2b2 has no serial start at all.
    Run my modified version of your program, the Parallax serial terminal will work.
  • Leave the Getlong's commented out until you have another prop transmitting matching number of Getlong variables. That's little Endian format
  • I changed the baud to 9600. make sure your serial terminal is set to the matching baud, and use the right com port.
  • In the 2b-1 program the main partof the program (BTN_W.. EW_PLS does not work, I think that when I start the serial the cog 0 stops.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-07-30 04:38
    I think everyone has shown that they really like to help, but they are frustrated and bewildered by the lack of "accepting the help". If you are begging as you say, then make sure you take the time to pick up those coins that are being passed your way. Sometimes the coin is a question, or a tip, or some code or drawings. If you are only picking up the shiny looking ones right at your very feet when you can be bothered then you may be missing the one that makes all the difference.
    I even gave you a tip where I said you can just save yourself a lot of trouble by skipping the Prop in the hand-held and simply using a 6-core cable to connect the switches and leds to all those spare I/O on the main driver Prop. Any response? Nada afaik.

    Sorry if this sounds like a lecture, but we are just trying to get through to you because it seems you can't be bothered to provide the information that's required. It's not like you don't have the time.

    As JonnyMac said ".... provide accurate information about this project; something that could probably be coded and operational in an hour our two if we knew all the details."

    If they are photos, then take the time to make them good ones with close-ups to show the details. Take the time to do some block diagrams, you can just use paper and then take a photo of them. When you answer questions in this way you are getting a clearer picture yourself of what you have and what you need, and we can help you because we get that same picture too. Blurry picture (or information), blurry response.

    btw, if you are local by any chance I will send you a serial 20x4 LCD no charge.
  • It work in your earlier version, I think you deleted that section out
  • Worked
  • In 2b-2 version I deleted the ser.start and the switches that emulate the guide camera controller worked fine which is important to me .As for Jakacki's info I don't have any room for another 6 pin jack, only the 4 pin jack. I am using the original panel.
  • Will give it a try tomorrow and let you know then. Thanks
  • bbrien,
    I second what Peter said about many people wanting to help.
    For the reasons Peter described, the forum assistance efforts have proved unsuccessful with dozens of forum posts making little progress in your telescope problem.
    I am normally a positive person, but cannot see how we will get your telescope working in this way.
    I think some face-to-face help is needed.
    Are you prepared to disclose your approximate location? Perhaps a competent forum member can volunteer to meet you.
    To retain your privacy, the actual address and meeting details could be by one-to-one PM.
  • bbrien wrote: »
    Under 'read mode pin' coding all that's happening is I am setting a ratchet for speeds. and assigning a led for each press of mode switch.Read direction pins is in two sections . In the first I am setting direction flags and the second part sets the speeds according to which mode we are operating in, low to high. Last four bytes for four output pins. W; Rmotor + Rdirect.(+) , E; Rmotor + Rdirect.(-), N; Dmotor + Ddirect.(+), S; Dmotor + Ddirect.(-)
    1; Speed is mode.
    2a;w,hen North button is Pressed The Dec motor will rotate low speed northward and in mode 2 , the same but a little bit faster, in mode 3 ,a lot faster and mode 4 almost full speed.
    3 a; east button similar but the R motor will be the one turning in an easterly direction. speed same as in
    north.
    4 a;copy north but direction is south
    5 a; copy east but direction is west.
    6; don't plan on it but it is doable since I use both counters in a cog.

    OK bbrien, I think we can now definitively write your user requirement for the handbox

    It is the same as the Meade operating manual, without all the multiple-press settings.

    HANDBOX USER REQUIREMENT ISS 1

    1) Direction Keys:
    Four keys, labeled N, S, E, and W on the hand controller (1), Fig. 14, are used to move, or microslew, the telescope in a specific direction.
    When pressing a direction key, the only feedback is the motion of the telescope.
    Only one button may be pressed at one time.
    Pressing more than one button is a null event.

    2) Coordinate System, Motors and Buttons
    Right Ascension (R.A.): RA motor; E, W buttons
    This celestial version of longitude is measured in units of hours (hr), minutes (min), and seconds (sec) on a 24-hour “clock” (similar to how Earth’s time zones are determined by longitude lines). The “zero” line was arbitrarily chosen to pass through the constellation Pegasus, a sort of cosmic Greenwich meridian. R.A. coordinates range from 0hr 0min 0sec to 23hr 59min59sec. There are 24 primary lines of R.A., located at 15-degree intervals along the celestial equator. Objects located further and further East of the zero R.A.grid line (0hr 0min 0sec) carry higher R.A. coordinates.-
    Declination (Dec.): DEC motor; N, S buttons
    This celestial version of latitude is measured in degrees, arc-minutes, and arc-seconds (e.g.,15° 27' 33"). Dec. locations North of the celestial equator are indicated with a plus (+) sign (e.g.,the Dec. of the North celestial pole is +90°). Dec. locations South of the celestial equator are indicated with a minus (–) sign (e.g., the Dec. of the South celestial pole is –90°). Any point on the celestial equator (such as the the constellations of Orion, Virgo, and Aquarius) is said to have a Declination of zero, shown as 0° 0' 0".
    Speed and rotation settings for motors;
    It is assumed these settings are adjusted in the Control Box.
    The default settings are;
    RA motor; N = counterclockwise, S = clockwise
    DEC motor ; E = clockwise, W = counterclockwise
    PWM;
    32X = 96% PWM
    16X = 48% PWM
    8X = 24% PWM
    2X = 12% PWM

    3) Speed:
    The SPEED key (2), Fig. 14, is used to adjust the speed at which the telescope moves when pressing one of the direction keys.
    The current speed will be indicated by one of four LEDs located next to the SPEED key. An illuminated LED indicates the current speed.
    Pressing the SPEED key will cycle the hand controller through the four speed options.
    The four speeds are:
    32X sidereal rate useful for centering the object in a viewfinder.
    16X sidereal rate useful for centering the object in a wide-field eyepiece.
    8X sidereal rate useful for centering the object in a high-power eyepiece.
    2X sidereal rate useful for guiding during astrophotography.

    4) Handbox - Control Panel Protocol and Refresh Rate
    The refresh rate for N, S, E, W direction buttons is 50Hz (same as RC protocol)
    The refresh rate for Speed button is 1Hz
    A 9600 baud serial link is to be used between the Handbox and Control Panel
    Speed button pressed; Select current speed by Cycling through the 4 speed options as indicated by local LED.
    The following data is to be transmitted for each refresh cycle;
    - Value indicating which direction button N, S, E, W was pressed for this cycle. (can be 4 bits).
    - Value indicating which speed (4 options) is current. (can be 2 bits)
    (One byte could contain the direction and speed information)
    - No button pressed = 0
    - Speed button pressed = 0
    - More than one button pressed = 0

  • That is more or less correct except in #2, The Dec is North And South.
    To digitalBob I tried the2b-3 program but there is no outputting on any of the output pins.
    My location is Los Angeles
  • I have been reading the method and cogs lab and the program for "FullDuplexSerialplus" and the cog zero launches the other cogs with their programs,and the fullduplexserial launches it's own cog so maybe I need to put the guide unit in another cog.
  • This is your version with serial working and PWM working when you activate buttons
  • This is your program with serial, display pwm count, and direction pin state. Leave out the Getlongs for now.
  • Now with this mod. I given you the ability to see serial on your Parallax serial terminal, and output some Putlong variables to another Prop from pin 25 and 24. Pulse and direction pins work as you have laid them out. Remember to use Getlong the recieving Prop has to match the transmitting Prop. So if your transmitting Prop has ser.Putlong(EW_Val) then the receiving Prop has to have EW_Val:=ser.Getlong. If your transmitting Prop has two Putlongs then the receiving Prop has to have two Getlongs. If the quantities don't match it will hang up. So when you use a Getlong in your program and there is no other Prop to transmit a Putlong to it, then it will hang up on then Getlong statement.
  • OK, I had to Tweek the Master program, no input, output on pins 25-24. This is the working pair Master and Slave Prop, Master sending EW_Dir and NS_Dir as EW_Val and NS_Val. On the slave you don't need the LCD, You'll see the values on the Serial terminal. Connect the serial pins correctly.
  • OK giving Them A try Tomorrow. Will let You Know In a couple of days how they work . thanks
  • I looked at the master program and it is full of "LCD stuff" and I have no need of the LCD Program as I have no LCDs and no place to put them. What I will do is rewrite the master Using the same variables as in the slave("Mount Brain") if they'll work in Prop C.
  • The program labeled 2b-8 Forum master has no LCD. It works with your pin setup and on the serial terminal, also it transmits two Putlongs on Pin 20. The program label 2b-8 forum slave has some LCD, but it doesn't matter it runs even if you don't have an LCD plugged in. The slave programs purpose is to receive the two Putlongs from the Master and display them on your slave prop's serial terminal. This just tells me that your not even loading these programs on your flips and testing them. So I guess you can bring a horse to water but you can't make him drink.
  • Thanks for the input I will have to reprogram the master and try it. also is there any problems with using prop C and spin on the other end(C on master and spin on slave).
  • In my master program I'm using pin 11 Rx and pin 10 Tx, in my slave program I'm using pin 21 Rx and pin pin 20 Tx. You can change those to whatever pin you need.
  • bbrien wrote: »
    I looked at the master program and it is full of "LCD stuff" and I have no need of the LCD Program as I have no LCDs and no place to put them. What I will do is rewrite the master Using the same variables as in the slave("Mount Brain") if they'll work in Prop C.

    Why would you do that? db has handed you a ready to rock system and has told you it should run as is. Just because he probably does not see the need to reprogram everything and test without LCD code doesn't mean it will not work for you. The LCDs are usually passive. "Thank you, I tried it out and this is what it did" would have been a much more appropriate response. Get off the garden path, try his code AS IS and then if you feel you must go down yet another rabbit hole, you will not have insulted the people who are trying hard and giving you time they could have used more productively elsewhere.
  • Tried the 2b-8 master . the terminal is a continuous stream of gibberish and none of the switches work and only full speed on motors for several seconds and then off for several seconds and on again. Will set up the slave system next and connect to master.I'll get back to you in a day or two. Also To FF I don't want to convert the master program(LX50A)( past the middle of page one.) from C to spin, too complex for me.
  • Gibberish tells me that your baud rates don't match on the serial terminals I used 9600, set your terminal to match. I don't have motors or an your H-brigde, but I do have buttons and an O-scope. This is what I get for the Master program.

    Pin 4: High state = PWM output on Pin 13 timed from Move constant.
    Pin 4: Low state = PWM output on Pin 13 timed from Moves constant.
    Pin 5 High state = PWM output on Pin 15 timed from Move constant and Pin 14 high state for direction.
    Pin 6 Low state = PWM output on Pin 13 timed from Moves constant and High state on Pin 12 for direction.
    Pin 6 High state = PWM output on Pin 13 timed from Move constant and low state on Pin 12 for direction
    Pin 7 High state = PWM on Pin 15 timed from Move constant and Pin 14 low for direction.





  • This is how my serial terminal looks like running the master program, note pin 4 is in the high state, the 600_000 is the value from the counter. I show the counter values so you know the PWM is active on pin 13.
  • I rest my case.
  • Is that the same Terminal found at the bottom of the "run" button in Propeller tool
  • or F12
  • @bbrien - a lot of your questions could be answered in very short time by yourself if only you would try something first. If you found "Terminal" in the Prop tool, then why didn't you try it? If someone supplies code that works, why didn't you try it? If it didn't seem to work, why didn't you check your settings? Learn by doing, try and fail, try and fail, until you succeed. If you are really stuck, then it is ok to ask a question, but make sure you take the answer properly and try it using the T&F method. Personally, I wouldn't have bothered to continue to mollycoddle you as you have been, although I would be quite happy to answer genuine questions to genuine problems.
Sign In or Register to comment.