Jump to content
IGNORED

What ways are there to get date and time in Atari?


Marius

Recommended Posts

@bob

 

Ok, I'm very interested in your fix.

 

I have tested a few more times, and like I wrote: My new write routine does not hang stuck, and indeed it does write to the RTC. But.................

 

Only the higher registers appear to work fine. Register 08 and higher do work. But in your original program they did that alread. So my 'fixed' routine is not fixed at all (grrrrr)

 

I think I'll wait on your solution. This was another 24h of Atari. Fun ofcourse, but I'm not coming any further :D

 

So hope you can find a fix.

 

When I understand your words right:

The problem is especially in the reading (that's why the NAK routine goes wrong in the writing routine). The RTC chip is only setting the lines low, but not high?

 

But as far as my technical knowledge reaches... isn't that why those pull-up resistors are there? As soon as the RTC chip sets the lines 'free' the pull-up circuit sets the lines to HIGH?

 

I suppose it works that way.

 

but isn't it 'enough' for the atari to see/detect?

 

Thanks

Marius

Link to comment
Share on other sites

Small update:

 

I wrote a small testtool in Turbobasic, which is able to send:

 

Start Sequence

Stop Sequence

true and false bits.

 

After 8 bits it reads back the Acknowledge (SDA low = OK)

 

This works. When I send wrong info to the card (like the first thing after start = 1111100) I get a wrong Acknowledge (SDA reads 1)

When I send right info to the card (like 11010000) I get right Acknowledge (SDA reads 0).

 

I'm not sure yet, but we can conclude here that reading and writing to the PORTA (PIA) works.

 

You don't need to set them back to 'input' ... when they are setup like you have in MKOUT routine, those lines work both ways.

 

Now it's time for further testing.

 

I wanted to let you know these results.

Greetz

M.

Link to comment
Share on other sites

Yes, I was looking at them on the oscilloscope and they switch just fine. What isn't so good is the transition time from 0 to 1. If you lower the pull-up resistor values to 2.2K - 1.5K, the pulses look much better. But, it fails all over the place if you do that.

 

Try lower resistors and make that work.

 

Bob

 

 

Small update:

 

I wrote a small testtool in Turbobasic, which is able to send:

 

Start Sequence

Stop Sequence

true and false bits.

 

After 8 bits it reads back the Acknowledge (SDA low = OK)

 

This works. When I send wrong info to the card (like the first thing after start = 1111100) I get a wrong Acknowledge (SDA reads 1)

When I send right info to the card (like 11010000) I get right Acknowledge (SDA reads 0).

 

I'm not sure yet, but we can conclude here that reading and writing to the PORTA (PIA) works.

 

You don't need to set them back to 'input' ... when they are setup like you have in MKOUT routine, those lines work both ways.

 

Now it's time for further testing.

 

I wanted to let you know these results.

Greetz

M.

Link to comment
Share on other sites

@bob

 

Well I don't have access at the moment to other resistors. I keep looking into the code for a solution. For some reason I simply do not understand WHY it does not work.

 

I'm going to write a step-by-step routine, where i can check status of PA0 and PA1 all the time.

 

Now I WANT (!) to know where it goes wrong.

 

Thanks for all your efforts. If you have any other suggestions, please let me know.

 

Greetz

M.

Link to comment
Share on other sites

At this moment I'm rather sure it is never gonna work on my computers. At least not without some hardware mod.

 

Like I wrote I wrote a tool in turbobasic.

 

These are the steps: read with me...

 

On the RTC Compatible XL this are the results:

 

1a. I send the start sequence

1b. After this: SLC=0, SDA=0

 

2a. I send the 11010000 byte (7 bit identifier, and a 0 for WRITE operations -> 8 bits in total)

2b. After this: ACK = OK (SLC is set to 1, and SDA reads 0!)

 

3a. I send 8 bits (all zero)

3b After this: ACK = OK (SLC is set to 1, and SDA reads 0!)

 

4a. I send start sequence Again (sending STOP here is not following the I2C protocol)

4b. After this: SLC=0 and SDA=0

 

5a. I send the 11010001 byte (7 bit identifier, and a 1 for READ operations -> 8 bits in total)

5b. After this: ACK = OK (SLC is set to 1, and SDA reads 0!)

 

 

On the XE (not compatible with the RTC) everything goes the same, except the LAST part.

 

1a. I send the start sequence

1b. After this: SLC=0, SDA=0

 

2a. I send the 11010000 byte (7 bit identifier, and a 0 for WRITE operations -> 8 bits in total)

2b. After this: ACK = OK (SLC is set to 1, and SDA reads 0!)

 

3a. I send 8 bits (all zero)

3b. After this: ACK = OK (SLC is set to 1, and SDA reads 0!)

 

4a. I send start sequence Again (sending STOP here is not following the I2C protocol)

4b. After this: SLC=0 and SDA=0

 

5a. I send the 11010001 byte (7 bit identifier, and a 1 for READ operations -> 8 bits in total)

5b. After this: ACK =FALSE! (SLC is set to 1, and SDA reads 1, which means ACK = FALSE)

 

 

Where and what is going wrong: I have NO idea. After each instruction there is a certain pause. All instructions are following the I2C rulezzz. It works on one of my Atari 800XL computers. And it fails -ofcourse- on that XE (where everything with the RTC fails).

 

I give up now. I don't know how to fix this. It is a no-go.

 

If you have any ideas. Please let me know.

 

Thanks

M.

Link to comment
Share on other sites

The only thing left to test for me is:

 

What if i connect RTC direct to PA0 and PA1 on PIA.

 

I found out that PA0 and PA1 are not directly connected to the pins of the joystick port.

 

There is a small resistance (180Ohm?) Between PA0 and Pin1 of joystick port.

 

Is there a chance it will work better when connected directly on PIA?

 

It is time for bed first now.

Greetz

m

Link to comment
Share on other sites

[quote name=Sub(Function(:))' date='Tue Feb 22, 2011 9:10 AM' timestamp='1298362215' post='2216347]

Hi Marius,

 

It struck me while reading this thread, how have you connected the RTC PCB to the joystick port?

 

I guess you soldered it. if so what are your solder skills like? I would suggest you check for "dry joints"

 

My solder skills are rather good if I may say so. Have been building all kind of PCB's since 1994.

 

But more important:

 

It works

The Joystick port is not a direct connection to pa0 and pa1, and that's WHY it fails.

I connected the RTC board now to PIA. PIN 2 = SCL, Pin 3 = SDA. Pin 1=GND, and PIN 20=VCC.

 

Original routines made by BOB do work perfect on this!

 

Hey Bob. I'm curious if you have same experiences when you connect the RTC to pia.

 

Greetz

M.

Link to comment
Share on other sites

I guess you simply can hook up a joystick to the port while inside the RTC is connected.

 

OK... the board keeps data low after the last read, but this can be fixed in the READ routine.

 

But after that. Playing joystick is only setting SCL or SDA low.

 

This can not harm the device.

 

You can not send a "$FC" with a joystick unless you can do up and down TOGETHER (smart joystick that would be eh).

 

So you can not send a "zero" bit to the device by using the joystick (since that sequence is

 

$FC (clock and data lo), $FD (data still lo, clock hi), $FC (clock lo, data lo, and the zero is written)

 

Since this is impossible with joystick you can simply use it.

 

Even when the RTC would get something to do with, it would definately respond with a #$FF (ACK FALSE) with is not a problem, since that is 'default' setting of joystick in center position, and will be overuled by the position of the joystick at that moment). When an I2C device is connected in a chain of I2C devices it will get 'strange' data all the time, so it is made to handle with that.

 

I'm interested in anyone elses opinion about this.

 

Greetz

Marius

Link to comment
Share on other sites

There are capacitors on the joystick output (.001ufd). Try removing them - your RTC should work externally, then.

 

Bob

 

 

I guess you simply can hook up a joystick to the port while inside the RTC is connected.

 

OK... the board keeps data low after the last read, but this can be fixed in the READ routine.

 

But after that. Playing joystick is only setting SCL or SDA low.

 

This can not harm the device.

 

You can not send a "$FC" with a joystick unless you can do up and down TOGETHER (smart joystick that would be eh).

 

So you can not send a "zero" bit to the device by using the joystick (since that sequence is

 

$FC (clock and data lo), $FD (data still lo, clock hi), $FC (clock lo, data lo, and the zero is written)

 

Since this is impossible with joystick you can simply use it.

 

Even when the RTC would get something to do with, it would definately respond with a #$FF (ACK FALSE) with is not a problem, since that is 'default' setting of joystick in center position, and will be overuled by the position of the joystick at that moment). When an I2C device is connected in a chain of I2C devices it will get 'strange' data all the time, so it is made to handle with that.

 

I'm interested in anyone elses opinion about this.

 

Greetz

Marius

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...