View previous topic :: View next topic |
Author |
Message |
neochrome32
Joined: 09 Jun 2013 Posts: 153
|
DS1302 RTC (i know its been done) |
Posted: Sun Aug 24, 2014 9:21 am |
|
|
Hi, im looking into using the RTC DS1302
however i dont have enough pins for the RESET line!
it looks like a CS line. CAN the CS be left HIGH (ON) at all times? as i plan to use the 2 remaining lines for the serial clock and IO?
thanks |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Sun Aug 24, 2014 10:08 am |
|
|
from the datasheet...
Input. CE signal must be asserted high during a read or a write. This pin has an internal 40kΩ (typ) pulldown resistor to ground. Note: Previous data sheet revisions referred to CE as RST. The functionality of the pin has not changed.
I assume it could be tied high, no harm in trying !!! Just be sure to test reads and writes to all registers....
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Aug 24, 2014 10:12 am |
|
|
The ds1302 data sheet says:
Quote: | 1. Driving the CE input high initiates all data transfers.
2. CE turns on the control logic that allows access to the shift register for the address/command sequence.
3. The CE signal provides a method of terminating either single-byte or multiple-byte CE data transfer.
4. At power-up, CE must be a logic 0 until VCC > 2.0V.
|
Even if it were possible for items 1-3 to somehow be ignored, I don't see
how you can avoid #4.
But you definitely can't ignore this one:
Quote: |
5. The countdown chain is reset whenever the seconds register is written.
Write transfers occur on the falling edge of CE. |
and
Quote: | 6. When reading the time and date registers, the user buffers are
synchronized to the internal registers on the rising edge of CE. |
|
|
![](templates/subSilver/images/spacer.gif) |
neochrome32
Joined: 09 Jun 2013 Posts: 153
|
|
Posted: Sun Aug 24, 2014 10:20 am |
|
|
nah, just found the answer, sorry lads, it was more of a "HOPE" than a sensible question.. sorry..
thanks guys
looks like i'll be losing one of the RAM address buss lines! from 512k to 256K |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sun Aug 24, 2014 3:31 pm |
|
|
If you already have I2C in your system then you could use one of the I2C based real time chips and sacrifice no additional pins.
For example the MCP7940 uses just SCL and SDA, the Multifunction Pin (MFP) is an optional output you can use.
Note that there are different versions of the chip, the 'M' version costs around $0.70 @ 1 piece but has no battery backup. The 'N' version costs around $0.90 and has battery backup.
This is a lot cheaper than $3.05 for the DS1302...
More info: http://www.ccsinfo.com/forum/viewtopic.php?t=50587 |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9173 Location: Greensville,Ontario
|
|
Posted: Sun Aug 24, 2014 4:17 pm |
|
|
The 'run out of pins' problem.....
I learned a long time ago to always choose a bigger PIC for 'the project'. In fact the 18F46K22, 40 pin DIP is my 'go to PIC' Size of the PCB is NOT the main issue, rather NEVER running out of pins, memory, etc.R&D labour and time is the BIG factor in getting a product from concept to customer.Rather than pay $$$ for 'can I rearrange my design for another pin...' which might take days and NOT happen, I prefer to spend a couple extra bucks up front for a PIC I KNOW will do the job(and a few 'extras' that always happen !).
If you can detail us the design, we might be able to 'rearrange' some I/O, maybe mux a pin or two to 'find' that extra pin you need.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
neochrome32
Joined: 09 Jun 2013 Posts: 153
|
|
Posted: Sun Aug 24, 2014 8:23 pm |
|
|
Temtronic, my pic is a dsPIC33EP 512 GHP 806, its 64 pins lol
although ckielstra, thanks for that tip!! i do have i2C setup already!
i'll have a look at this chip!!! thanks!! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19365
|
|
Posted: Mon Aug 25, 2014 12:42 am |
|
|
One question is are you using the internal oscillator, or a crystal?.
If the latter, then consider switching to an external oscillator module. You can then use RC15.
Saving a pin this way is always worth considering, especially since an external oscillator module can also drive other things.
However the I2C RTC, may well be the easiest solution. |
|
![](templates/subSilver/images/spacer.gif) |
neochrome32
Joined: 09 Jun 2013 Posts: 153
|
|
Posted: Mon Aug 25, 2014 11:27 am |
|
|
yeah i've opted for the i2c RTC (i dont like i2c protocol much)
also i used to use the DS1307 but the systems a 3.3v and thus doesn't work so i am using the MCP7940N alot more compnents, but in the end, i need stability on this machine..
i know its done many many times, but i am building a mini Androidy type thing, my own OS tho 512k isn't enough for a real android thing lol
im using the dsPIC internal clock as i need the pins from the OSC1 OSC2 pins lol... i didn't want to use the 80 pins as that would juist be wasted legs in the end
i2c puts me back on track |
|
![](templates/subSilver/images/spacer.gif) |
|