G30 Required Pins and Power Modes

Can I please have some detailed explanation on how the required pins are to be used (LDR0,LDR1,Reset, and Mode) as well as how power modes are set. At one point I knew what LDR0 and LDR1 did but I have forgotten and am not seeing it in the data sheet other than that it is required to be exposed.

I know that Reset needs a pull up resistor as per the data sheet - a switch can then be connected to it to pull it low and initiate reset, correct? This must be a dedicated switch I assume. What if I don’t want to add a button solely for resetting? Are there any good ways around this? I read that reset is triggered when leaving off mode. Which leads me to my next set of questions…

I will be adding battery back up to the G30 for keeping track of an RTC clock as well as keeping the battery powered RAM on. I am doing this to have a warranty cycle counter as well as length of time. How do I switch between sleep, deep sleep, and off? It sounds like off mode is all I need to keep the RAM and RTC stored, once powered up the value stored in RAM will be written to an EEPROM, I assume RTC is automatically kept track of. How long will the battery last for each respective mode / circumstance? How does one go about changing the battery without losing the RTC? Should there be a capacitor on the line?

As for MODE, that pin is solely switching between USB debug and serial debug correct? What if I will only ever be using USB debug?

Please let me know if I am missing anything or need to know anything specific about LDR0, LDR1, Reset, Mode, or battery power, as well as if there are any other design notes I need to be aware of when putting a G30 on the PCB (I am aware of the needed resistors and no connect pins).

The datasheet should have all the information you need.

Specifically for LDR0, LDR1, and MODE, their states are discussed in chapter 6. Given the default state of the pins, if they are left unconnected, the device will boot in USB mode and run the application. You can change this behavior by setting the required state on those pins. Even if the default is fine today and you keep the pins unconnected, a future update may add behavior. LDR1 for example is not used in NETMF, but in TinyCLR we added functionality to that pin.

For reset, as long as you pull it in the specified direction, the device will run. While you don’t need to connect a button, we strongly recommend exposing the pin in some way so that you can reset the board. Otherwise device updates may be difficult and only accomplished by removing and re-adding power.

Your safest bet long-term is to expose all four pins – at the very least as pads on your device.

How long the battery lasts is specific to your setup and battery. The easiest way to keep time while changing the battery is to keep the device powered normally while doing so, assuming the processor supports that. For specifics on low power, RTC, and battery backed RAM, you’ll need to consult the processor manual from the manufacturer and take a look at the RTC doc and the low power doc.

Do these 4 pins all have internal pull ups?

On the topic of power, the data sheet says 0.1 uF decoupling at each power pin. So pins 19, 64, 48, and 32 all need their own 0.1 uF between them and ground correct?

Is it possible to run the battery RAM for years? What would be the best type of battrey / voltage? The battery’s sole purpose would be the RAM, at all times the device is being used it will be plugged into an AC outlet. However, when the device is shut off when not in use I need the battery to come into play. I will get an estimate from customers how often it is not in use. Is it possible to have a rechargeable battery that is juiced up when plugged into the main power source?

It seems like the power mode I will need is just off…When it is not in use I will not need any pins to be active, just the RAM powered which is possible while in off mode?

@John_Brochue while I have your attention can you please send me a complete parts list of the G30 development board? There aren’t any part numbers on the schematic.

The pins, except reset, are pulled high on power up.

The power pins just need a 0.1uF near them. Exact placement is very board specific and not something we can give a recommendation on.

Whether or not you can run the battery RAM for years is a question better directed at the underlying processor manufacturer, for the G30, this is ST. I can’t think of any technical reason, but we haven’t tested it anywhere near that duration.

How the VBAT pin is supplied is up to you. It doesn’t need to come from a battery, it just requires whatever voltage and current specified in the processor datasheet. A rechargeable battery is one such possibility.

If the device is not being used you can physically disconnect power from it and as long as the power supply for the VBAT pin remains, the battery RAM and RTC will keep their contents.

We do not make a parts list of the G30 Dev Board available, only the schematic.

ok, I have to ask… why do you think you need to do that? What features of the battery RAM are you using, and why, given you have an external EEPROM ?

The battery is to maintain an RTC for the purposes of telling us when a warranty has expired on the device.

@John_Brochue Can you please tell me what the crystals being used are? What does Q1A and Q1B mean?

Q1A and Q1B is the same crystal in a different packege, so you have more options without changing the PCB, if a device e.g. becomes unavailable or much more expensive.
The crystal is a 12MHz.

Why do you need to use the RTC as a warranty time keeper?

Is the device warranty x num of days it is actually running? If not surely you know when the device was purchased then the 1 year warranty starts from that date?

Many of our units are stripped of serial numbers by our customers and resold. There is no telling which device is which it has been a problem for years. So we would like to use the RAM as a buffer for a cycle counter being saved to EEPROM as well as an RTC to know how old the unit is as well as to disguise our logo until its resold then make it pop up to piss off these customers who lack morals.

And yes the warranty does have to do with how long its running which is why I am adding a cycle counter which will be stored in EEPROM. But if the device gets shut off without allowing a power down sequence, the counter will be lost. Thus I will be using the RAM as a buffer for the counter when it is powered off then save it to EEPROM upon powering up. Haven’t ironed out the details on the cycle counter yet but RTC will be straightforward if I can get the battery supply reliable.

that’s micro-amps required to maintain the RTC - nothing to do with battery RAM being required or not (it’s not)

I am not sure what you mean. The data sheet says there is battery backed up RAM which is what the RTC uses when there is no main power source, i.e. the device is unplugged from the wall and being transported to another laboratory.

you have to be more precise with your words.

“The real-time clock (RTC) is an independent BCD timer/counter”. “The backup registers are 32-bit registers used to store 80 bytes of user application data when VDD power is not present”. The RTC does NOT use the backup registers, but they are both powered by Vbat when there is no Vdd.

So there is a benefit I see in using battery backed RAM is that the write lifecycle on your EEPROM can be controlled better when you buffer the updates into that and check they match (or not) on app startup and write the correct values as needed.

So can I use any 12 Mhz Crystal? Or does it have to be one of those packages used? Not sure what the packages are from the picture.

Let me clarify - I want both of the functionalities of the battery features to last for as long as possible. I would appreciate some recommendations on battery circuits for the G30 / some long lasting rechargables as my supervisor has never worked with rechargable circuits.

battery charge circuits are completely non trivial, and maintaining supply in powered and non-powered times, but more particularly during the transition between these two states, is challenging. You’re lucky because your power needs for RTC are extremely low, but I’m sorry to tell you that you’re not likely to get someone here able to whip out a solution to this quickly. What battery chemistry are you going to use? That should lead you to find a charge controller chip. Then, once you have found that, you would need to look at their app notes and start to develop the circuit based on that.

You can use any package you like, just use a 12MHz and fitting loading-caps.

Btw. for how long do you want the battery to last? Why not using a Goldcap or something?
On what is your warranty based on? Isn’t the first time the device was powered on enough? Maybe it can check if it has been powered on, if not it sets a timestamp onto an external EEPROM (that you can read out even if the MCU has been gone) maybe with some kind of override-switch for factory-tests before sale…

This is what the owner of our company wants so I am making it happen. What load caps would I need for this crystal? 18 pF?

I would like the battery to last a few years, it definitely should if its not being used most of the time and is only powering RAM and the RTC. I was told 3 years with a 2032 by someone with a great deal of uC experience. He said I shouldn’t even need rechargeable (he can whip out a circuit for me if I need it so no worries on that front).

On a side note, how hard is it to control two I2C devices on the same line in NETMF? I need to switch to an I2C display and my EEPROM is already I2C

well it all depends on your requirements about batteries and powering the RTC - you need to work out requirements (and you’re the only one who can do that, not us). Yes, CR2032 or equivalents can provide VBAT power for a long time, Yes they can be used and not recharged, many YES and NO depending on what you want to do. You do the math on battery capacity and RTC runtime requirements.

load caps are easy as well - but are also hard. You need to factor in total capacitance, pin capacitance, trace capacitance etc, to get the full story. Then do the maths - if the crystal says it needs 18pF total, and ignoring traces etc, then you need 36pF caps.

https://old.ghielectronics.com/docs/12/i2c shows a multiple I2C device scenario and should be all you need