dspics - just starting out

Discussion in 'Embedded Systems and Microcontrollers' started by Art, Apr 12, 2015.

  1. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    Hi Guys,
    I’m looking at doing my first project with a dspic 33FJ64GP chip that wants a 3.3 Volt supply.
    I’m sure I’ll have the supply sorted out with a fixed regulator LM2576.

    My question has to do with the chip being connected to 5 Volt peripherals such as character LCDs
    or other pic chips that use 5 Volt supply.
    Does this mean you also need a 5 Volt regulator on the same board, and do level conversion for everything?
    In that case why not use a resistor divider to power the dspic form the 5 Volt regulator?

    In the case of connecting the DSpic to a 5 Volt pic pin, would small signal transistors suffice?
    Cheers, Art.
  2. ak52


    Oct 15, 2014
    There are LCDs available which run on 3.3v,what LCD are you using?
    A simple solution is to use a 5v LDO connected to a 3.3v LDO/switching regulator(Depending on your PCB space requirements).

    A few issues need to be addressed when powering PIC from voltage dividers.This is not very efficient way of powering PICs.
    The PIC will draw a vary-ing amount of current depending on what you are it is executing.
    This will vary the total current drawn through top resistor and will change the voltage across bottom resistor across the PIC.
    A protection diode like a zener or a tvs diode must be used and the diode must be able to handle more than this maximum current draw.And on top of that you still need filter capacitors at the input and outputs.
    A simpler way is to use voltage regulators which would take care of all these things for you.

  3. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    atferrari likes this.
  4. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    Ok, thanks for the replies :) The LCDs are 2 units of 2x16 char or 2x20 char Hitachi based character LCDs.
    The reason for 2 x 2 line units is for where they have to be a horizontal display rather than a single 4 line unit wouldn’t fit.
    I already have plenty of these (5 Volt supply units) and would like to select the biggest two units that fit.

    jpanhalt, I’m sure if it’s a common problem, Maxim probably have a big chip with rows of inputs/outputs but I have not yet looked.

    In the picture you linked, D3 is just an ordinary 1N4148? i.e. not a zener because it’s a DC clamp?
    I don’t understand the top one (3V to 5V translation). Do you care to explain it?
    Other than that, I’ll get started and wait till I get stuck, and come back with an actual problem.
  5. takao21203

    AAC Fanatic!

    Apr 28, 2012
    they can work from 3.3v just need a higher drive voltage for the glass, incidentially, its just a little more than 3.3
  6. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    1) It is not a problem any more than any other design requirement.
    2) Go to the Sparkfun site and read about those designs. Did you look at any of the links I provided? The first link not only also explains the designs from Sparkfun, which are quite common and not proprietary, but gives some other options, including direct connect (Tip#5).
    3) Just buy the Maxim chip.

  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    When faced with the same issue off a 3.3V PIC I went thru some complicated things that were completely unnecessary had I read the spec sheet on my display: Seems a 3.3V logic 1 voltage is well within the sped’ed limit of inputs on my displays and they would have been quite happy when just driven off 3.3V logic signals.

    Do check your specific devices data sheet but I would expect the same spec.

    For other devices (such as I2C busses) there are dedicated level translators available.
  8. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    Sorry John, I did glance at the links, and check if my local electronics place stocked the Philips device,
    which unfortunately they don’t.... but something like that might be on Maxim free samples list.

    ErnieM, If that is common, then I probably have a pair of LCDs that will work.

    It’s for Sun & Moon calculator algorithms I want the dspic for.
    The whole board only has to have the 3.3 Volt variant of Maxim's RS232 transceiver (which I do know exist),
    and the two LCD displays, and that all for that whole board. The time date and location data for the algorithms
    is already being sent over the RS232.
  9. atferrari

    AAC Fanatic!

    Jan 6, 2004
  10. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    Perhaps I should have gone for a dspic 30F series which can run up to 5.5 Volts.
    I wasn’t aware there were any 5 Volt pics that still worked with C30 compiler.
    Oh well.. I’ve come too far now, already have a dual supply board and dspic 33F flashing an led.
  11. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    I might be useful to open up for criticism, so any thoughts would be appreciated :)

    Though I have a few different LCDs, the one I want to use expects 4 Volts for logic high,
    and my reading suggests they are the kind that won’t work without level shifting.

    In the picture, the two orange LEDs are lit because both 5 & 3.3 volt supply rails work.
    To the left of the orange LEDs, the 74HC04 provides the clock signal to the dsPic
    via the transistor clamp example given in the Microchip document linked by jpanhalt:


    The highest value series resistor R1 from the 74HC04 output that would clock the dsPic is 1K.
    The next higher value I tried for R1 was 4.7K which did not get the pic started from the external clock.
    Q1 on the protoboard is BC557B.

    The third LED (first green LED from the left) is lit because the dsPic is running a timer flashing it
    at 1 Hz, 50% duty cycle. This LED is supplied from he 3.3 Volt rail, and sunk by the IO pin.

    The fourth LED (second green LED from the left) is lit because a second 74HC04 sees a
    logic low on another IO pin connected to it. This LED does also flash at 1 Hz rate though,
    proving the logic high from the dsPic is recognised. Both 74HC04 chips are supplied 5 Volts.

    The dsPic IO pins connected to the 74HC04 are connected directly with no pulp/down resistors.
    Is this ok?
    I know I will have to drive the whole LCD display with inverted control signals and data.

  12. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    Ah well it’s working so far with 74HC04. I wouldn’t have thought HS family was ideal.
    It doesn’t calculate any astronomy yet, just prints it.

  13. NorthGuy

    Active Member

    Jun 28, 2014
    Unless there's a compelling reason, it's good to have everything in single voltage.

    Latest and greatest dsPIC33EV runs at 5V and has shadow registers to die for.
  14. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    Thanks for the tip :)
    This one was successful at least.
    There is a reason, an astronomy calc needs location data,
    And that will probably be a Ublox GPS module.