Shop OBEX P1 Docs P2 Docs Learn Events
1302 clock code — Parallax Forums

1302 clock code

ChetChet Posts: 150
edited 2008-08-17 00:34 in General Discussion
I loaded the code from DS1302_RTC_2x16 LCD_A.SXB and have a strange problem.· If I run it in the debug mode, it runs perfectly.· If I run it in the regular mode, it does nothing.·I do have the 4 MHZ resonator installed.·1I am using the parallax 4x20 lcd and the SX Tech board.
I have changed the subroutine designation to the SUB·subname instead of subname: and have changed the pin definition to PIN instead of the VAR designation.

Search has not turned up anything about a symilar problem.

Any help is appreciated.

Thanks

Chet


added code

Post Edited (Chet) : 8/16/2008 12:28:40 PM GMT

Comments

  • ZootZoot Posts: 2,227
    edited 2008-08-16 05:19
    Can you post your code?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • Shawn LoweShawn Lowe Posts: 635
    edited 2008-08-16 14:34
    Do you mean it isn't displaying on the LCD? Do you get anything?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    When all else fails.....procrastinate!
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-08-16 15:09
    Please provide more detail and pictures are good too (if the LCD displays anything). I am the one that wrote that based on forum members help in some of the routines.

    I just connected up my project and have attached a couple of pictures showing the SX-Key connected and not connected. I also used a brand new never tested DS1302 and crystal that I opened from the packaging from Parallax. All is working fine on a 4x20 display (although it was intended for a 2x16 - but either will work).

    Let·us know what else you are seeing.

    Thanks.


    Post Edited (T&E Engineer) : 8/16/2008 3:19:07 PM GMT
    1200 x 1600 - 479K
    1200 x 1600 - 463K
  • ChetChet Posts: 150
    edited 2008-08-16 17:10
    With the exception of the board, all the "clock" associated components are "new, never experimented" from Parallax.· I can run the program in the debug run mode·and the display is correct and the time and date·are correctly displayed (see pictures below).· I have tried with and without the·SX-key attached.· The backlight does not turn on when "running" in the normal mode.· The BL does turn on correctly when running in the debug mode.

    The board layout is different in that I am using RC.0, RC.1, RC.2 instead of the RA lines in the example code.· (RA.0 and RA.1 are used for another project I am working on as well) The serial data out to LCD is RA.2.
    The resonator is 4MHZ (virgin as well)·Th four pins have been changed accordingly in the version I am using.

    I am using the bETA version of SX/B.· I tried doing it using the previous version, but the results were also negative. No LCD action.

    The LCD display works normally with other programs.
    640 x 480 - 142K
    640 x 480 - 140K
    640 x 480 - 132K
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2008-08-16 17:15
    I believe Guenther Daubach·has information on this, in his FAQ sticky·about this problem and your last post.
  • ZootZoot Posts: 2,227
    edited 2008-08-16 17:25
    Forgive if I'm asking the obvious -- when you try to run w/o the Key, you do "run->program" first? Then power down, disconnect the key, insert 4mhz resonator, power up? When you debug, you power down, remove resonator, connect key, then "run->debug"?

    Have you tried OSCXT2 instead of OSCXT1?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-08-16 19:19
    I have only slightly modified Chet's program as RETURN statements were left in instead of the new ENDSUB statements. Other than that, all I did was comment out the RC pin usage for the DS1302 and used the RA pins (as mine is soldered on my SX28 proto board).

    Chet's modified program does run fine.

    See attached program.

    Comments?
  • ChetChet Posts: 150
    edited 2008-08-16 19:27
    Zoot, I have done all the normal procedures you described above. I will try the OSCXT1 and see.

    Captain Quirk, I will go through the Guenther Daubach FAQs and see what I find.

    This is what weekends are for (once you finish the honey-do list)

    thanks
  • ChetChet Posts: 150
    edited 2008-08-16 20:16
    SUCCES..

    When I tried "run"ning the program where the sx key generated the 4 mhz, the program ran OK. When I tried to run the program regularly, it failed.
    I tried the OCSTX2, without result.
    I replaced the resonator with another "virgin" 4 mhz, no result.
    I decided to go to a 50mhz resonator and made the changes to the FREQ statement and OCSHS1 in the device line and behold... The program works like a charm.
    The good part is, I learnt a little along the way.
    The bad part, is I still do not understand why the 4 mhz did not work? (gave away my scope a while ago...)
    I will order a few more 4mhz resonators next time.

    To all, a word of thanks.

    Chet
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2008-08-16 20:41
    Chet,

    Try your 4MHz resonator in another program and see if it also fails.

    Your modified program ran fine for me with a 4MHz resonator.

    Good luck.
  • ChetChet Posts: 150
    edited 2008-08-17 00:34
    T&E Engineer, I used another program with the 4mhz resonators and the following statements:
    DEVICE SX28, OSCXT1, TURBO, STACKX, OPTIONX, BOR42 'use an external resonator such as 4 MHz
    FREQ 4_000_000
    and it did not work on one of the resonators. When I installed the other one, it flaked out as well after a few minutes. I recoded the other program for 50 mhz and it ran OK. The alternate program is normally running OK on the internal clock. The alternate program also sends data at 19200 to the LCD. It looks like I had two bad (virgin) 4 mhz resonators. ???
    I will get some new ones and see. A good excuse to order some other goodies.....

    Thanks
Sign In or Register to comment.