Shop OBEX P1 Docs P2 Docs Learn Events
Prop Plug and LQFP (Prop 1) — Parallax Forums

Prop Plug and LQFP (Prop 1)

Greg LaPollaGreg LaPolla Posts: 319
edited 2020-01-16 04:53 in Propeller 1
I have designed a PCB using the LQFP chip. In the past I have used the dip without any issues. Using the prop plug I get a timeout on the upload.

I have attached the schematic. I am converting an older controller from a 4 line lcd to a 2x3 touchscreen lcd. Also converted it from through hole to surface mount components. Do I need to put an actual usb port on the board with the lqfp chip or should this work ?


Thanks in advance!
«134

Comments

  • JonnyMacJonnyMac Posts: 8,912
    edited 2020-01-16 00:30
    I have a bunch of boards with a simple 4-pin header for engaging a Prop-Plug.

    I'm probably a bit pull-up happy, but I'd be inclined to add a pull-up to the SCL line of the EE (mine and other libraries require it), and also on the SD pins so they're not floating when no card is inserted.

    It looks like the you the emitters and collectors on your NPNs swapped. Am I wrong?

    Can you share details on the touch-screen that you're going to use?
  • I have a concern with this design. That LM1086-5 has an absolute maximum voltage rating of 27 volts, and you have an apparently unregulated 24 volt input. IMHO, thats cutting it really close, and that regulator is going to be close to the edge.

    It appears the only thing using that 24-volt output are the relays. If so, what would you think about dropping the input voltage down, maybe to 12 volts, and using 12 volt relays?

    Looks like a solid design otherwise!
  • Using 24 volts because it controls a gas valve that is 24 volts ac. Trying to save save space in the controller box. The voltage at the 5 volt regulator hovers around 18-19 volts coming out of the rectifier depending on how many relays or activated. So no issues there.



  • JonnyMac wrote: »
    I have a bunch of boards with a simple 4-pin header for engaging a Prop-Plug.

    I'm probably a bit pull-up happy, but I'd be inclined to add a pull-up to the SCL line of the EE (mine and other libraries require it), and also on the SD pins so they're not floating when no card is inserted.

    It looks like the you the emitters and collectors on your NPNs swapped. Am I wrong?

    Can you share details on the touch-screen that you're going to use?


    Its just a simple ILI9341 based tft display off Ebay for around 12 bucks. Also you are correct on the transistors. I was just trying to figure out why the relays click on when power is applied. Looks like 20 bucks for the PCB's are down the drain.
  • JonnyMacJonnyMac Posts: 8,912
    edited 2020-01-16 01:46
    Its just a simple ILI9341 based tft display off Ebay for around 12 bucks. Also you are correct on the transistors. I was just trying to figure out why the relays click on when power is applied. Looks like 20 bucks for the PCB's are down the drain.
    If you're handy with a soldering iron you might be able to dead-bug TO-92 packages onto the pads.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-01-16 06:58
    If you are doing a new board, do yourself a favor and instead of trying to use a linear reg for 24V to 5V, use a standard 3-pin regulator pinout instead and use a cheap Recom 5V switcher module instead. They can handle up to 32VDC and switch cleanly down to 5V and up to 500ma for this particular low cost part. The 3.3V regulator doesn't need to handle much power since it regulates from 5V so you can get away with using very small packages and typically I use SOT89 or SOT23 packs without any problems.

    I doubt you need pull-ups on your SD since these combo lcd modules normally put them on, even if you don't want them and I never use any, especially on the CS line since this the card's internal pull-up doubles as card detect. If you use EEPROM don't even bother with the original 32kB, just go to 64kB as that is standard these days and the extra 32kB can be handy for logging.

    I'm sure you are aware of all the EMI and ground precautions when handling inductive loads such as relays and what they switch.
    How'd ya get the transistors back-to-front? :)

    BTW - if you show us your pcb artwork before you order, we might have a tip or two.




  • Did you try to only load RAM. I just had a bad EEprom connection, which ofcause gives a time out. But I was still able to load RAM.
  • RaymanRayman Posts: 13,797
    I think you might have RX and TX backwards on the PropPlug connection...

    Look here for how it should be:
    752 x 705 - 21K
  • JonnyMacJonnyMac Posts: 8,912
    edited 2020-01-16 19:48
    Ray is correct: The TX pin on the Prop-Plug connects to RX (P31) of the Propeller, and vice-versa. This explains why you can't download to the board. To keep moving with debugging, you could use a some short M-F jumper wires. I know, because I had to do this a couple times when I had an error in my part library that propagated through to the PCB.

    I now name the Prop-Plug nets USB_RX and USB_TX to keep things clear.
  • RaymanRayman Posts: 13,797
    Jon, I dug up your old Propeller Platform schematic to get the above...
  • JonnyMacJonnyMac Posts: 8,912
    edited 2020-01-16 20:33
    I thought that looked familiar. :)
    The problems I experienced were after moving to Diptrace and not paying attention.
  • Greg LaPollaGreg LaPolla Posts: 319
    edited 2020-01-16 21:40
    I discovered the same thing last night that rx and tx were incorrect. I have corrected the issues and sent new Gerber's in to get a new pcb, Should be here on Tuesday.

    It seems funny that 5 PCB's are $2 bucks and then $17 to ship!

    I have moved away from Diptrace because it is to much of a hassle on a Mac. I now use KiCAD and I had to re-do the board and did not consult the propeller doc and just connected tx to tx and rx to rx.

    I did make a few changes:

    added pull-ups on miso and mosi on sd card and changed 5 volt regulator to one that has a max input of 30 volts just to be safe.

    Thanks for the input!

    Also new schematic is attached

    If you are interested in the TFT display

    here is where you can find it: 3.2 inch 240*320 TFT LCD Module Display with Touch Screen Panel SD Card Cage

    I have used some objects from OBEX to get it all working: ILI9341 SPI driver and the touch object from: ILI9325 320x240 TFT driver
  • Cluso99Cluso99 Posts: 18,066
    Never used pullups on MISO & MOSI for SD. The only pullup I've used is on /CS and of course it's not needed as the SD card supplies it. I do use a 10K pullup on /Reset tho'. So a 4-pin smt does EEPROM SCK & SDA plus /Reset and the /CS for the sdcard.
  • Cluso99 wrote: »
    Never used pullups on MISO & MOSI for SD. The only pullup I've used is on /CS and of course it's not needed as the SD card supplies it. I do use a 10K pullup on /Reset tho'. So a 4-pin smt does EEPROM SCK & SDA plus /Reset and the /CS for the sdcard.

    Yes, I don't trust internl pullups on reset and always put 10k there. I also learned from bad experience with one of my first boards with the P1 that the reset pin is very sensitive to glitches. So I always put a cap (10..100n) from /res to GND and as close to the chip as possible.
  • Using 24 volts because it controls a gas valve that is 24 volts ac. Trying to save save space in the controller box. The voltage at the 5 volt regulator hovers around 18-19 volts coming out of the rectifier depending on how many relays or activated. So no issues there.

    From 24vac you will see 34V peak! (24*sqrt(2)) From your voltage measurements, I would guess that your meter is reading average voltage. The diodes drop about 1v each, so the output of your rectifier would be 32v peak, 22v RMS, and 19.5v average. It would not be unusual to see 10% more voltage in some situations.

    10uF is not really enough capacitance for the load of those relays. The datasheet says the coil is 576 ohms. Plugging that into the calculator here https://changpuak.ch/electronics/power_supply_design.php shows that with only 1 relay on, the capacitor voltage falls to 5v when the AC crosses zero.

    Adding more capacitance would help somewhat. The problem will be that too much capacitance will result in the RMS voltage being more than 24v. A good solution might be to place a diode between the 24v net and C1. That would stop the relays from draining the capacitor during zero crossing. The relays should operate from the unfiltered bridge rectifier output just fine. It's unlikely they would release during zero crossing.

    Another option would be to add a lot more capacitance on the rectifier output and use 5v relays. You'll definitely want a switching regulator for this setup, such as the R-78C5.0-1.0 Then your board could run off a wide range of input voltages.
  • So I sent the Gerber's off and I received my boards back with the ground plane missing. Trying to figure out how that happened. Waiting for the PCB manufacturer to get back to me. In the meantime I made some more changes based on the discussion here.

    Here is the the pcb and the schematic. Open to constructive criticisms and comments!

    Thanks
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-01-29 21:19
    On your pcb, I presume that all four Vcc prop pins are connected together, and all 4/5 GND pins ate connected together. These need to be short track or a power/ground planes. Looking closer, you should re-route your Vcc pins to be shorter length between the prop pins.
    Some pins appear to not connect to your not shown ground plane - this will most likely fry your props internal pll. You must fix this!

    While certainly not mandatory, it is usual in I2C designs to have a pullup on both SDA and SCL pins. The props boot code always drives the SCL which is why some prop designs dont have an SCL pullup.
  • @Cluso99

    So unused pins should be grounded ?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-01-29 23:57
    @Cluso99

    So unused pins should be grounded ?

    All 4 ground pins are never "unused", they must all be connected to ground. It's not like all 4 pins are shorted together inside the package, they connect to various ground pads on the silicon and while you can get away with only connecting one during light testing, the chip will be compromised or damaged with these other grounds left floating. If it helps, think of the internal ground pins as being connected by very low but fusible resistance. You don't want parts of the chip to be damaged or misoperate when a bit more current is involved, so just ground them as they were designed to be.

    As pointed out, that 10uF in the rectifier circuit is virtually useless. It is normal to have 1,000uF or so for the ripple filter but could be vary depending upon the peak current requirements.

    P.S. Please use a 3-pin switching regulator to 5V or at least allow for it on the pcb. Using linears for such high voltages is just bad design unless you are still in the 80's in which case you just use great big regulators mounted on heat sinks.

    BTW, I noticed that while your schematic shows all 4 pins grounded, your pcb does not conform. On the subject of schematics, try and orient the symbols in such a way that makes it easier to read the schematic. For instance, don't have the emitters of NPNs pointing up to a ground, point them instead, especially since it is a very easy thing to do.




  • @"Peter Jakacki"

    All the gnd pins go to the gnd plane. I just turned pour off so you can see the traces. I was inquiring about unused prop pins should they go to gnd if not used ?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-01-30 02:14
    But I don't see any vias unless you mean a ground plane on the top layer.

    Edit: I see the VCC is not joined together if this other ones are the grounds. It's good to have a partial plane for the VCC too.
  • Cluso99Cluso99 Posts: 18,066
    Unused I/O pins can be left unconnected. But you must absolutely connect the 4 Vcc pins to 3V3 and the 4 GND pins to GND. AND the track lengths between those VCC pins MUST be short, not "around the world" and similarly the GND pins (but youu have a ground plane which will do this).
  • Just an update -

    Got the boards yesterday. Everything working properly finally. Not bad for my first SMT board.

    Made a few more design changes. As mentioned by several, I went with the recom 5v switcher and wow no heat! Also upped the caps on the power supply to 1000uf.

    Using solder paste and a hot air rework station makes soldering a snap!

    932 x 878 - 155K
    1013 x 1024 - 138K
  • Congrats, @"Greg LaPolla" ! Well done!
  • I remember that unused pins can be left not connected, but one should set unused pins at output low to reduce the power consumption.

    interesting display... :smile:

    Enjoy,

    Mike
  • That is one very nice piece of work. One question though. The relays are 24V relays on the coil side, but what voltage levels are you switching with them. If you are switching mains voltages it may be worth a respin of the board with the signal and low voltage connectors on the prop side of the board and the mains on the opposite side of the board for isolation and protection. Looks like it would not take much to make that change. Also if these are line voltages, are there fuses located off board so that your relay contacts don't get fried in the event of a fault?
  • @"frank freedman" two of them are switching 110vac and the other is switching 24vac. The traces for the relays are in fact on the opposite side (see the lcd side picture). The 110 is fused coming into the control box with a 5 amp fuse and the relays are rated at 10 amps, should be safe there. The pumps draw 1.4 amps each and the electric gas valve is next to nothing, so I should be good.

    This is a remake of a controller I made 10 years ago . that had a 4 line lcd. I just redesigned it to use smt instead of through hole components. I also removed the ADC because I changed temperature sensors and went from K type to a one wire based sensor, much easier to use and program for. I also dropped the PH sensor off as my ph sensor broke and it was very expensive to replace it. I see now looking on amazon that they are dirt cheap but I have to question the quality.

    The only thing that I would like to do is rewrite the code in C, but I cant find a library to support the ili9341 chip that drives the tft screen and I really don't feel like writing one myself.
  • Throw it at Spin2cpp and look at the result, or use fastspin and just use the Spin Object from C.

    Enjoy!

    Mike
  • Greg LaPollaGreg LaPolla Posts: 319
    edited 2020-02-15 22:22
    @msrobots as the saying goes "Been there done that" . Coverts without any errors, compiles clean and thats where it stops. Code doesn't run. Seems that spin2cpp is not so good and converting spin with assembly in it.
  • Cluso99Cluso99 Posts: 18,066
    edited 2020-02-15 22:44
    Since you have live ac on the pcb, have you kept a clearance between the ac side and low voltage dc copper? IIRC this should be a minimum of 5mm of no copper otherwise a pcb nonplated slot. I forget the standards numbers.
Sign In or Register to comment.