RTC module - Easypic5


Closed Thread
Results 1 to 12 of 12
  1. #1
    malc-c's Avatar
    malc-c Guest

    Default RTC module - Easypic5

    Working out the pin mapping for a project and my lack of experience has lead me to another question.

    I've purchased one of the RTC2 modules for use with the EasyPIC5 board and I'm stumped on the ideal port to use with the target PIC which is an 18F4550.

    The documentation on the module suggests that it uses RC3 (SCL) and RC4 (SDA), however the datasheet on the 18F4550 states that RC3 is not implemented (why it don't say). I'm therefore assuming that I can't use the RTC module with this PIC ?

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    The PIC18F4550 has Vusb on pin 18 - where SCL is located for most (if not all non USB) PIC18's. To get the RTC2 to work with the 4550, you will need to use PORTB with RB1 (SCL) and RB0 (SDA).

    Probably easiest to use PORTC of something like a PIC18F4620. Or better yet, look into a PIC18F4xJ11 with a built-in RTCC.
    See here http://www.picbasic.co.uk/forum/showthread.php?t=12553
    Last edited by rmteo; - 4th February 2010 at 20:18.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the suggestions

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What is a RTC2 ?
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Dave,

    Here's a link to the RTC2: http://www.mikroe.com/en/tools/rtc2-proto/

    Malc-c,

    You can use this with pretty much any pin that I2CWrite/I2CRead work on, and
    you can probably find several PBP examples here for working with the DS1307.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce,
    I was going to suggest what you did but though maybe it was something special.
    Just a regular RTC...

    I use the 1337 on a 4550 with pins PORTD.0 and PORTD.1.
    For whatever it is worth....
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hey Dave,

    Yeah - it's just a plain-old DS1307.....)

    Malc-C,

    Here's one of the best examples I've ever seen for PBP using the DS1307 by Melanie;
    http://www.melabs.com/resources/samp...ted/MN1307.txt

    I suspect the reason they recommend specific pins was due to them using hardware I2C
    in the sample code they provide for the RTC module.
    Attached Files Attached Files
    Last edited by ScaleRobotics; - 10th February 2012 at 02:48.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  8. #8
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    I suspect the reason they recommend specific pins was due to them using hardware I2C in the sample code they provide for the RTC module.
    That is correct.

  9. #9
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks once again for all the input.

    I'll take a look at those examples. I've not used any I2C device before so forgive me for these noobie questions - and Reading TFM just confused things

  10. #10
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post

    You can use this with pretty much any pin that I2CWrite/I2CRead work on, and
    you can probably find several PBP examples here for working with the DS1307.
    True, especially since you're using a complete module. If you were using a plain RTC chip, I'd suggest choosing 2 pins which are weak pull-up capable, the'd save you 2 external resistors on the signal lines.

    Regards,

    Anand

  11. #11
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default pin outs

    Quick question, I'm having problems reading the schematic of the board http://www.mikroe.com/pdf/rtc2_schematic_v100.pdf

    The board doesn't have the 3 x 2 header shown, just the 5 x 2 which connects to the easypic5. As I need to breadboard these modules to connect to the spare pins I'll have and not take up a full port can some one tell me what pins on the 5 x 2 header I need to connect to the PIC (other than supply )

    EDIT: - just looked at the code and previous replies... RC3 and RC3 are suggested, so that would be pins 4 and 5 on the header
    Last edited by malc-c; - 5th February 2010 at 20:29.

  12. #12
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    One possibility to consider. If you do not need all the features of a full-blown RTCC (especially the calendar and alarm), you can implement a real time clock on a PIC18 with just a watch crystal and 2 capacitors - less than $0.30 in cost.



    Using the Secondary Oscillator (RC0, RC1, and TIMER1), all it needs is just a few lines of code to implement an interrupt driven real time clock. Look at the data sheet section for TIMER1 for more details.

Similar Threads

  1. Version Control
    By btaylor in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 16th October 2011, 17:12
  2. Replies: 1
    Last Post: - 27th July 2008, 06:14
  3. Oscillator stops when touching with a wire
    By Wilbert Ingels in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 25th April 2008, 08:51
  4. PIC 16F877 I2C communications
    By sigmoideng in forum General
    Replies: 7
    Last Post: - 13th July 2007, 10:28
  5. X1226 RTC - Help
    By charudatt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th August 2006, 17:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts