Shop OBEX P1 Docs P2 Docs Learn Events
Please Help with PWM Pal Connections — Parallax Forums

Please Help with PWM Pal Connections

clloydclloyd Posts: 31
edited 2008-11-12 05:21 in BASIC Stamp
The datasheet somewhat confuses me stating that it is supposed to connect directly underneath a 24 pin module. I dont think I am able to do that so I understand that I have P12-15 as the motor outputs and P0 as the serial IO. Where is the Vcc, ground, or any other possible "needed" connections.

Post Edited (clloyd) : 11/9/2008 2:52:18 AM GMT
«1

Comments

  • clloydclloyd Posts: 31
    edited 2008-11-08 18:36
    Also cant even tell which pins are which, it states that P1 is identified with a dot but I see no dot so if there is any way someone could point to me which pin is pin 0 that would also be great.
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-08 20:22
    Your post reads as if you had written a description of whatever problem you're trying to solve, and then cut off the first several paragraphs and thrown them away, posting only teh last one-tenth of a description. Why not tell us what you're talking about? Then maybe someone can help.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-08 20:30
    I'm with Carl: complete sentences would help a lot with your question.

    In the attached PWMPAL photo, the dot referred to is the white one visible right next to the "P" of "Parallax". The pin next to it is pin 1. Assuming that your PWMPAL looks like that one, you should have no trouble identifying pin 1.

    As for your other question, why are you unable to mount it beneath a module? If it's because you're using a surface mounted BS2, you should probably be using a SERVO PAL instead.
    700 x 437 - 116K
  • clloydclloyd Posts: 31
    edited 2008-11-08 21:02
    Sorry for the lack of clarity.

    The PWM Pal we have says REV B rather than REV A, not sure if that makes a difference as far as what it does or not. It also does not have the white dot but I am going to assume that the white dot would be to the left of where the parallax is written. And no we are using the stamp evaluation board B2sE not the 24 pin module so it doesnt seem as if we can mount it underneath of it as it states in the datasheet. As far as the pins go:

    If Pin 1 is that upper left pin the where would be P0 the one that is stated in the datasheet:

    Pin PWMPAL Function Dedicated
    P0 Serial link between BASIC Stamp / PWMPAL Yes
    P8 Counter 1 input / Motor 1 HW control No
    P9 Counter 2 input / Motor 2 HW control No
    P10 Counter 3 input / Motor 3 HW control No
    P11 Counter 4 input / Motor 4 HW control No
    P12 Motor 1 output No
    P13 Motor 2 output No
    P14 Motor 3 output No
    P15 Motor 4 output No

    Does P0 refer to Pin 1? And thus P12 would be the pin on the bottom right of the PWM pal chip? Also still wondering where I would connect the Vdd and the ground. Not sure how much I can define my problem, just need to know the pin connections on the chip.....
  • sylvie369sylvie369 Posts: 1,622
    edited 2008-11-08 21:46
    That table of pins from the documentation refers to the I/O pins on the BS2 module. You can see how BS2 I/O pins are assigned to physical pins on the chip itself by looking at the schematic here:

    www.parallax.com/Portals/0/Downloads/docs/prod/schem/BS2revJSchematic.pdf

    For example, you'll notice that I/0 pin 0 is physical pin 5, the fifth from the top on the left side of the module (and therefore also on the PWM Pal module, as it plugs into the BS2 in a one-to-one way). The power and reset pins are 21-24, over on the top right side:

    21 - Vdd
    22 - Reset
    23 - Vss
    24 - Vin

    Pin 4 is also a Vss pin (ground).

    I think that you're safe in assuming that the pin next to the "P" of "Parallax" on your unit is physical pin 1 of that unit, even if there is no little white dot.

    However, I don't know if you're safe in assuming that you can just plug separate wires from your BS2 module into those little holes on the PWM Pal. You might want an expert opinion on that (read: someone from Parallax).

    Post Edited (sylvie369) : 11/8/2008 9:55:43 PM GMT
  • clloydclloyd Posts: 31
    edited 2008-11-08 23:25
    That is exactly what we need, thank you. As far as the wiring goes the plan was to place the PWM pal into a chip socket and solder wires to the bottom of the chip socket, I think this method should work. Our plan was not to use the tiny holes for the same concerns you had, I dont think it would be a good option to shove some wires into those holes.

    Thanks a lot!
  • clloydclloyd Posts: 31
    edited 2008-11-09 00:13
    For the PWM Pal we are having trouble getting any output, here are our hardware connections and software:

    Hardware:
    We connected P4 and P23 to ground. Connected P24 and P21 to +5V. Connected P22 and P5 to the microcontroller (For the input and the reset). We connected P17 to a motor then tested with LED and multimeter and it was not outputting anything.

    Software:
    SEROUT PWMPal, PWMBaud, [noparse][[/noparse]"!PWMM1", 50, 0, $EE, $02] '50 Hz adds up to 800;
    SEROUT PWMPAL, PWMBaud, [noparse][[/noparse]"!PWMSS", %00010000] ' enable PWM outputs

    Tested these commands in both orders, no results.

    Any suggestions?
  • clloydclloyd Posts: 31
    edited 2008-11-09 00:42
    PWMBaud is set to 9600
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-09 05:40
    clloyd said...

    We connected ...·connected P24 and P21 to +5V ...
    For clarity, let's refer to the physical pins as Pin1 through Pin24, and to the logical pins as P0 through P15.· P0 is on Pin5, P1 is on Pin6, etc.· ·You should connect Pin21 to +5v, or Pin24 to a higher voltage (in which case Pin21 becomes an output to power other parts of the system).· Not both!· But this probably is not causing the problem, unless you're really connecting both of these to, say, +9 volts -- but you say you're feeding them +5v.· Still, it's a known error, something to try, since as you have it hooked up you're shorting the output to the input of the internal regulator.· That might cause the regulator to crowbar down to zero.· Some regs would do that, most would not.

    Do you know the Stamp is actually functional?· That is, does it work in, say, a BOE or a Homework Board?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
  • clloydclloyd Posts: 31
    edited 2008-11-09 15:51
    "Do you know the Stamp is actually functional?· That is, does it work in, say, a BOE or a Homework Board?"

    If you are referencing if the microcontroller (we are using a homework eval board)·is functional, then yes it definitely is.· But should everything else work?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-10 17:04
    The PWM Pal could be connected externally to a Stamp Module…you would need any I/O connections you have identified, as well as VDD (+5V) and ground. The pins these signals go to corresponds to the same pins the PWM Pal would connect to on a module if you had it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • clloydclloyd Posts: 31
    edited 2008-11-10 21:32
    We have Basic stamp homework board and the PWM -pal we have just purchased.
    We dont have the 24 pin stamp module.



    Can we use the PWM pal with homework board and if so what is connected to where.

    There is an example code to blink an LED on the data sheet of the PWM pal, I think that would be a good start off for us. But all the connections we
    have tried did not seem to work with the Home work board and PWM pal

    So if you would help us what to connect where and make it work. (or just to say "what would you do if you have PWM pal and a Homework board )

    thanks

    clloyd's Friend

    Post Edited (clloyd) : 11/10/2008 9:37:24 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-10 22:12
    I think that the attached should help get you interconnected.· The HWB has 220Ω series resistors on the I/O lines.· I think that should be OK.·

    Post Edit -- I don't know if a connection to Reset is necessary.· I don't see a trace connected to it in the pic·attached by·Sylvie.· Haven't located a schematic.·

    The labels on the Dwg. refer to the labels on the HWB headers.

    Previously you posted "Connected P24 and P21 to +5V."· Not good. ·Vin is from the battery and Vcc is 5V (they are different.)· Looks like only Vcc is used.

    Post Edited (PJ Allen) : 11/10/2008 10:42:42 PM GMT
    589 x 381 - 60K
  • clloydclloyd Posts: 31
    edited 2008-11-10 22:48
    I just did that, and the chip started smoking ...
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-10 22:53
    You just did what exactly?
  • clloydclloyd Posts: 31
    edited 2008-11-10 23:05
    PJ.

    The connection diagram you have given me actually, we have tried it.

    but it never worked,

    My question is, is it even possible for the PWM pal to work with HW board? at all?

    If not, can we buy the 24 pin module and connect it to the PWM pal and still be able to control it using the HW board?


    We are doing a project. we already setup all other components such as (GPS, digital Compass) to work with the H.W board and every things is working right.
    But now we want to add motors which will be operating based on GPS and digital compass reading.

    As you know the motors need some kind of PWM, so that was why we needed the PWM pal but that just does not seem be able to work with the HW board.

    If you have any suggestions ?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-10 23:12
    The PWMPal was designed to go into the BS_Stamp socket on a BoE.· That said, I don't see why it could not work with an HWB.· Chris has indicated that it's possible, too.

    If you connected PWMPAL pin 21 to "Vin", as a previous post indicates, then it may have snuffed it.

    Post Edit -- it's the "smoking" thing, man, not good

    Post Edited (PJ Allen) : 11/10/2008 11:19:28 PM GMT
  • clloydclloyd Posts: 31
    edited 2008-11-10 23:28
    May be it may have been snuffed as you said.

    but

    What
    Chris Savage
    Parallax Engineering
    said is that you can connect it to the 24 pin module and the pins "The pins these signals go to corresponds to the same pins the PWM Pal would connect to on a module if you had it." but he did not mention any thing about the HW board and as you know the HW board has only 15 I/O so how do we go about that?

    But
    before we buy another one I just wanted to make sure 100 % this things works, with the HW board or some one to tell us what other components we may need to control the PWM pal from homework board.

    Thank you
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-10 23:38
    "...as you know the HW board has only 15 I/O so how do we go about that?"

    Not so.· The HWB has 16 I/O lines, P0-P15; P0, 8, 9, 10, 11 are used by the PWMPAL.

    As I see it, if a PWMPAL was connected in accordance with the diagram I attached then all should be well.

    Before buying anything further, you should seek guidance from Parallax Tech Support.
  • clloydclloyd Posts: 31
    edited 2008-11-10 23:51
    Sorry I mean 16,

    and obviously all the GPS and digital compass as well may be a servo motor takes up a couple of pins on the HW board.

    So we can't connect the PWM pal as if it is connected to a 24 pin module (of course that's impossible because we only have 16 pins). But on the diagram you sent me I have modified some things and take a look at it, and let me know what you think ?

    Post Edited (clloyd) : 11/10/2008 11:57:31 PM GMT
    1218 x 641 - 35K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-11 00:04
    Why aren't you using P0 for the serial comms?· No, don't tell me.

    I guess you could connect PWMPAL pin 5 to HWB's P9 --·but make sure that you comm using SERIN 9, SEROUT 9 (not SERIN 0, SEROUT 0.)

    Post Edit -- In this context, I don't know what "IED" is that you have·on pins 19, 20.
  • clloydclloyd Posts: 31
    edited 2008-11-11 00:15
    Sorry it is an LED not IED (my paint editor cut it off)

    But what we were trying to do there is that at least to begin with blinking an LED that was shown and on the data sheet

    http://www.parallax.com/Portals/0/Downloads/docs/prod/acc/PWMPAL.pdf page 13 and the code is there as well

    And of course on the program we begin with

    ' =========================================================================
    '
    [noparse][[/noparse] I/O Definitions ]
    PpPin PIN 9 ' PWMPAL Serial I/O

    .
    .
    .

    '=========================================
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-11 00:24
    So, you're trying "Example 3".· Your drawing didn't show a resistor, which is necessary, and you need the bi-color LED for that, too.·

    I'd look at the output/s (MOT1 - MOT4, PWMPAL pins 17-20) with an oscilloscope.· Sorry, but, the smoking doesn't bode well.
  • clloydclloyd Posts: 31
    edited 2008-11-11 00:59
    sorry the resistor is there, I just did not draw it.

    and the LED is a bi-color LED.
  • clloydclloyd Posts: 31
    edited 2008-11-11 03:57
    I am just wondering, Is it even possible ?

    I mean some one has tried this before? Is there any one who has access to these two components and be able to prove that we can generate a signal.

    (connecting PWM Pal with HW board? and getting a signal?)

    If so I don't mind buying other PWM pal but we need to do it ASAP. because if some one recommended another component as well, it would be good to buy all the things needed and put them in one shipping order.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-11 16:24
    It seems like there is a lot of miscommunication going on here. When I saw your LED diagram my first thought was there would be some smoke (no resistor). You say it is there but see, we’re going by what you show us. Now, as for what I said, let me clarify…

    The PWMPAL is a 24-pin smart socket. If you’re going to plug it into the breadboard on the H/W Board then you need to provide the connections it would normally require if it was connected to a standard 24-pin module. Let’s start with the basics…you must have a common ground.

    Pin 23 on the PWMPAL is VSS. This should go to VSS on the H/W Board.
    Pin 22 on the PWMPAL is /RESET, but this is optional so we won’t connect it.
    Pin 21 on the PWMPAL is VDD. This should go to VDD on the H/W Board.

    Now for signals…

    Pin 5 on the PWMPAL is the serial I/O line. For compatibility with existing code this should connect to P0 on the H/W Board, although any I/O line could be used if the code reflects this. These are the only connections required. The PWM outputs can be picked directly from the PWMPAL itself (using common ground).

    I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-11 18:48
    I built the system exactly as I described and there is one change I need to make for this to work properly. Having not used the PWMPAL in almost a year I had forgotten that the /RESET line is required in the sense that the /MCLR pin on the on-board SX20 connects directly to it. Without a pull-up this line floats and the SX won’t start up. Simply connect a 10K resistor between pins 21 and 22 as shown in the attached pictures. This provides the necessary pull-up and everything works fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
    1280 x 1024 - 266K
    1280 x 1024 - 243K
  • clloydclloyd Posts: 31
    edited 2008-11-11 18:53
    Chris,

    We are doing a group project. So we were trying to get help as much as possible in our own way.
    Such as one person discussing in the forum, the other may be emailing Parallax, or calling and getting suggestions.




    Thank you I just got the picture

    Post Edited (clloyd) : 11/11/2008 7:02:03 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-11 20:14
    When you move the support around like that it slows us down in helping you while we try to catch up to who has helped you with what. In the future if you post a message in the forums, that is where we will support the question. By sending private messages and support e-mail it puts us in the position of having to answer in three places taking up time on both ends.

    Is your project working with the information above? As you can see I connected a scope probe to be sure the PWMPAL was doing what it should be, but you can also just run the version ID code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • clloydclloyd Posts: 31
    edited 2008-11-12 00:59
    Thank you so much Chris,


    That tip helped (pulling high the reset)
    It is working fine now. The Bi directional LED is going well

    Thank you again for your great help and all the good people who contributed to this.


    clloyd and friends
Sign In or Register to comment.