1302 clock code
Chet
Posts: 150
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
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
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.
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
Chet's modified program does run fine.
See attached program.
Comments?
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
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
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.
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