Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: DS1307 troubles...

Re: DS1307 troubles... 8 years 2 months ago #8545

  • Jon Chandler
  • Jon Chandler's Avatar
  • Offline
  • Moderator
  • Posts: 365
  • Thanks received: 352
There's one other hardware consideration. Per the data sheet, if a backup battery is not being used, Vbat must be grounded. It doesn't say what the consequences of not doing this are but ground it if you're not using a battery.

My familiarity with Proton is limited so I haven't gone through your code in any depth. One thing (definitely a show stopper) is how you've represented the DS1307 address:

[proton filename=code.bas]main]

BStop[/proton]

11010001 should be a binary number. You know that and I know that but to the compiler, this number is 11 million and change!

To tell the compiler it's a binary number, it must be preceded by a percent sign]

BusIn 209, 0, [Secs, Mins, Hrs, day, Date, Month, Year, Ctrl]

BusIn $D1, 0, [Secs, Mins, Hrs, day, Date, Month, Year, Ctrl]


as long as the proper syntax is used.

From the Amicus documentation]
Numeric Representations
The compiler recognises several different numeric representations:
Binary is prefixed by %. i.e. %0101
Hexadecimal is prefixed by $ or 0x. i.e. $0A , 0x0A
Character byte is surrounded by quotes. i.e. "a" represents a value of 97
Decimal values need no prefix.
Floating point is created by using a decimal point. i.e. 3.14
[/quote]
The following user(s) said Thank You: RogerTango

Re: DS1307 troubles... 8 years 2 months ago #8623

  • RogerTango
  • RogerTango's Avatar
  • Offline
  • Fresh Boarder
  • Thanks received: 2
Well guys, I got it working. Im an idiot.

Thanks to Jon with the % prefix, Im sure that was a help... but not near as big a help as putting the resistor on the clock pin like I was supposed to. It was one hole off and not connected.

I lost a lot of time due to not verifying CLOSELY the wiring. I did check it, but I over looked the resistor mainly because I was so certain everything in that area was "A O.K.".

I also lost my wallwart PSU, which was run through a 7805. This created the first delay in debugging.

Then I took an ATX SPSU and rigged it up to run, and tapped the +5 off it to run my project board. Worked great! Until the PSU started to NOT start up!

So, I had to hack together a quick linear PSU, with a transformer I salvaged out of an old radio a long time ago (15v), I put together a quick full wave bridge with a few 1N4001 diodes, added a fat cap for smoothing, then ran it though a fresh 7805 with a heat sink. Its ugly as sin, but works a charm!


Andrew

Re: DS1307 troubles... 8 years 2 months ago #8624

  • RogerTango
  • RogerTango's Avatar
  • Offline
  • Fresh Boarder
  • Thanks received: 2
My home brew PSU!
Attachments:
Time to create page: 0.249 seconds