DS1307_v2008.SXB external clock problem
Nothing has me more excited than to see
"Friday
October 10, 2008
22:49:03 PM
Friday
October 10, 2008
22:49:04 PM"
etc.
This will be for water timer, etc. I'm using a ds1307 mini module and 5v rs232 mini module. The code is mostly the same, but I'm having a few qwerks, I'm not sure why.
SX48 proto board with 50mhz resonator that came with the the latest programming package. It says 500? on it.
I commented out the put time stuff because the time has been set now
The problems are a) it doesn't display civilian time, not a big deal, but I don't think I did anything to make it fail. b) it stops out putting to the serial port after a little bit. I can't get it to start again until after I do another program. Turning it off and on doesn't do it.
Thanks Jon Williams for the code!!!!!!!!!!!!!!!!!!!!!!!!!!!
Post Edited (Capdiamont) : 10/24/2008 4:51:03 AM GMT
"Friday
October 10, 2008
22:49:03 PM
Friday
October 10, 2008
22:49:04 PM"
etc.
This will be for water timer, etc. I'm using a ds1307 mini module and 5v rs232 mini module. The code is mostly the same, but I'm having a few qwerks, I'm not sure why.
SX48 proto board with 50mhz resonator that came with the the latest programming package. It says 500? on it.
DEVICE SX48, OSCHS2 'HS1 ', TURBO, STACKX, OPTIONX 'XT2 4mhz FREQ 50_000_000 Baud CON "T9600" 'PUT time, $00, $30, $22, Fri, $10, Oct, $08, 0 'SET_CLOCK
I commented out the put time stuff because the time has been set now
The problems are a) it doesn't display civilian time, not a big deal, but I don't think I did anything to make it fail. b) it stops out putting to the serial port after a little bit. I can't get it to start again until after I do another program. Turning it off and on doesn't do it.
Thanks Jon Williams for the code!!!!!!!!!!!!!!!!!!!!!!!!!!!
Post Edited (Capdiamont) : 10/24/2008 4:51:03 AM GMT
Comments
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
HS1 doesn't seem to start it at all. HS2 will start it after programing(ctrl+p) but if I turn it off, it doesn't seem to start up. I assume it should start work and output quicker than doing a program after turning it on.
will make the civ hours right. Will see after 1 or so.
I have my resonator in the x2 socket, reading online, that should be right. Do I need to add any resistors/capacitors to make it work with out the sxkey? I'm thinking no, I shouldn't have to. Maybe programming adds a little kick? Or is there stray capacitance/Resistance added by the key that makes it work?
I lost the resonator!!!!!!!!
I tried the other resonator which should be 4mhz, says 400cm812 on it. so I set the freq to 4_000_000 and tried the various XT2, HS1, and HS2 yet no serial out.
I tried run(ctrl+r) at 4mhz and 50mhz but either no serial out, or buggy.
Would radio shack have a resonator that would work, in stock?
I know when I bought the kit I bought extra resonators, but can't find them.
Why doesn't the 4mhz one work, that I got with the programming kit?
Different resonators require different drive levels.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It is our choices, Harry, that show what we truly are, far more than our abilities."·Dumbledore from Harry Potter
www.iElectronicDesigns.com
·
Is it ok to use some electrical tape to hold those resonators down, to prevent losing them?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
Great news though my code modification to the civilian hour display above, works great.
My ideas are a) hook up serial out to different computer b) add flashing led as heart beat for the SX. c) try the code on the sx tech board, to give me both new sx and board to try. d) I monitor PS. E)I have no idea.
I tried hoking it up to my desktop with built in serial port, and get no serial out. I know I'm on the right comm port of that computer, by looping back the tx/rx pins, I can see what I type. I still using my laptop to program it. That may cause a problem, I don't know. it is winXP com1, 9600(using T9600 on sx) 8,N,1 no flow control
My normal way is to program and read the serial port from the laptop(win vista). Programming i use the USB key, for the serial port I use the Parallax USB to serial(232)
So a short recap. Currently using OSCHS2. It will not boot up without it being HS2, even with this new resonator. However after a short bit, it will stop outputting serial.
I put in TOGGLE HBLED right after GET_CLOCK in Main:. HBLED is RB.0. It stops toggling when it stops serial out.
The power supply can supply 3.5A
VSS to VDD voltage is 4.94v
ground to XO on the X1 clock connection gives 169.2mv. ground to xI gives 4.94v
during programming Xo gives about 1.3v xI gives about 11.86v. Measuring voltage during programming doesn't allow it to boot, no serial out.
OK, I've replaced the resonator with another new one. It is running for a good bit after programming, but still stops, and will not start without being programmed.
Post a schematic or sketch if you can.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
is the rs232 mini module www.futurlec.com/Mini_RS232_TTL_5V.shtml
is the 1307 mini module www.futurlec.com/Mini_DS1307.shtml
code is attached(I think).
Tomorrow I'll take a photograph of the setup
VDD from sx48 proto board goes to VCC on both mini modules
VSS from sx48 proto board goes to GND on both mini modules
RA.0 goes to TX0 of RS232 mini module
RA.1 goes to RX0 of RS232 mini module
RA.2 goes to SDA of 1307 mini module
RA.3 goes to SCL of 1307 mini module
RB.0 doesn't go to to anything, I monitored it using a multimeter.
RS232 mini module
TX1 is tied to RX1, makes it nice, just have to move the cable from port 0 of max232 to port 1 to do a loopback test.
TXD goes to Pin2 of 9 pin
RXD goes to Pin3 of 9 pin
The jumpers for the resistors on the 1307mini module is set to on(ENA)
Could I be frying the resonators by programming with them in?
Looking though sxlist.com, someone had to add 4.?v brownout protection because the PS didn't come up fast enough. Maybe?
We will see how well the photo upload goes.
adding BOR42(brownout 4.2v) to the device line didn't help.
Still stopping serial out after a little bit.
1st try at making the sx tech board work, didn't.
- on the protoboards, /MCLR is already tied to Vdd through a 10k resistor (see the schematic for the boards at Parallax.com). Additionally, spec for the SX is to tie /MCLR to Vdd through 10k, not 4.7k or some other value
- RTCC can be tied to Vdd directly or through a 10k. I usually just tie it high. I don't think this would affect your particular application.
Question: the en/dis jumpers on your RTC board are for enabling/disabling pull-ups on SDA and SCL? Is that right? So we should presume that SDA and SCL are pulled-up in your current setup?
Now, in the code, it looks like you *must* receive a byte from the host (your PC?) in order to have the program continue after it TXes the time? Is that right? Are you indeed TXing to the SX from the PC? In other words, can you read the time out once? If so, if you TX a display command to the SX again, what happens?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
also "A: When the RTCC input is not used, it is a good idea to tie it to some defined level instead of leaving it “floating”. A good idea might be to connect it to Vdd via a pull-up resistor of say, 4.7 kOhm.
Imagine what would happen in an "ISR-less" application when you have set bit 5 in the OPTION register by some reason (i.e. RTCC roll-over interrupt enabled), with a floating RTCC input randomly incrementing the RTCC, and finally causing a jump to $000 on a roll over. As your program does not contain any spe-cific ISR code, it might restart, or perform some other crazy operations."
so that is where I got the 4.7k. Though I completely skipped over the reset button area of the schematic when I was looking through it. I'll have to remove the MCLR resistor I put in. I think the RTCC pin should be tied to something.
The jumpers on the 1307 board do enable/disable the 10k resistors built in to the 1307 board and are enabled.
what is happening, is I do get the serial out asking what type of display I want after doing a program(ctrl+p). I choose, and it send the wanted formatted time out. It keeps repeating the time out until it randomly stops. I haven't been able to get it to start without me doing a program with the resonator already plugged in. Looking through the code, it doesn't care if the PC transmits again. I think I've hit keys while it was displaying the time, but not sure. Will have to test.
Edit:
I forgot to say that i removed my resistor from the MCLR to VDD, no help. The program indeed does ignore input from the PC once the display has been chosen. Typing on the PC at that point doesn't cause the SX to stop.
Also I edited my serialtest program so unused pins are input pull up. No help.
Post Edited (Capdiamont) : 10/19/2008 7:51:51 PM GMT
How long should it take to self start an external clock sx?
Do you have a pullup (4.7k or so) on your serial pin (open true)? Not sure it would matter with your PC serial board.
Tying RTCC to Vdd is fine.
Have you tried a simple experiment just to see if the SX(es) are transmitting/receiving properly without hiccups? That way you could at least narrow down if it's the SX and it's related code/circuitry or something with your PC rx/tx board and the PC. I would set up one SX as a TX and one as an RX -- send a serial byte from one to the other (TTL serial, no driver needed). Have the RXing SX do something like:
IF rxByte = %01010101 THEN
Led = 1
ELSE
Led = 0
ENDIF
And have the TXing SX send that same byte every few seconds, then send 0 every few seconds. Basically have the TXing SX turn the led on and off on the RXing SX. If that works, then you can be confident that your RX/TX and SX setup is OK, and the question will be getting it to work properly to your PC through the driver (or vice versa
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
It has to be a hardware issue, if it stops flashing the LED in that program after a short bit. I have the ds1307 and the serial rs serial mini modules disconnected electrically from the proto board, and yet it will still stop after a short bit with the external clock.
http://forums.parallax.com/showthread.php?p=748823
for the idea. a 10k in place of the 1meg resistor didn't seem to work with my mini modules connected, however with the LED flash program alone, it works.
So with the current setup, OCSHS1, in device 4_000_000 for freq, I can get it to run for a good while after programming, till I give up. Though, one glitch is the select display screen doesn't go away when I press a key on the PC. I have to remove the RX/TX leads from the mini module, to get past it.
I still can't get it to self start.