DS1302 Real time clock questions, PIC18F2620 SPI mode and microcontroller memory usage

I have the following questions:

  1. For DS1302 real time clock, there is an option to connect a backup power source to Vcc1. However, I'm not too sure what source that I should be using, but I'm thinking something along the lines of a watch battery. Any suggestions would be very helpful.

  1. For the PIC18F2620 MSSP module, if I want to control devices in SPI mode, is it by default that I can only control one device by SPI with that microcontroller? I know that I can only communicate to one device at a time b/c I only have one module, but would it be appropriate if I have a few unused I/O pins to be used as addressing outputs to a decoder to have the decoder's output be used as Chip Enable for setting which device I want to communicate to? Also, would I cause any damage to a SD card or real time clock chip if I have data streaming into or out of the slave devices when the chip enable for that particular slave device isn't set to high?

  2. In the event where I can't easily communicate to multiple devices through SPI on a single microcontroller system, how hard would it be to write data on the unused memory of the microcontroller?

Thanks for your time in terms of looking into the questions.

Reply to
ssylee
Loading thread data ...

Maxim has an Application Note on their website that discusses backup coin-cell battery for their RTC products. Start there. We use the DS1307 here with a 2032 coin cell. No problems.

Not familiar with your PIC, but many SPI devices are addressable and you can put more than one device on the SPI bus. It is also fairly easy to bit-bang SPI, so don't feel you need to lock yourself into uPC's that only have SPI.

For Question-3, I don't see how this relates. If you want to write to unused uPC memory, it will have to be of a type that accepts in-application programming (such as FLASH storage). If you use RAM, this memory is volatile and will be lost if power is removed.

I am assuming you want to implement memory storage off-chip (off uPC) using the same SPI bus as your other device. Many uPC with onboard EEPROM or FLASH memory storage that can be used for non-volatile data are typically pretty small, 2K or less. If you need more than that, a serial EEPROM is probably the better approach.

-mpm

Reply to
mpm

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.