Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Facts about CIA and... question.
2015-02-12 17:04
Flavioweb

Registered: Nov 2011
Posts: 463
Facts about CIA and... question.

Obviously, correct me if i'm wrong.
- I know that CIA's counters $DC04..07, $DD04..07 never reach the value $00 during countdown, but $01 is repeated twice (EDIT: not $01, but the reset value is repeated twice).
- After that, i know that CIA's TOD alarm 1/10 seconds register, can't be set at value $00 otherwise the alarm does not work.
- Then i know that, if ICR is readed 1 or 2 cycles just before an IRQ generated by Timer B occur, then IRQ don't occur at all..
But... what are "the differences" between CIA revisions?
Not all of these bugs occur on all revisions or there are other differences?
2015-02-13 07:40
j0x

Registered: Mar 2004
Posts: 215
See http://codebase64.org/doku.php?id=base:detecting_6526_vs_6526a_.. for a bit more info.
2015-02-13 19:02
Flavioweb

Registered: Nov 2011
Posts: 463
Quote:
...sets off a single-shot NMI ... The older 6526 triggers one cycle later

This mean that the IRQ is triggered 1 cycle later, or the timer start to count one cycle later?
2015-02-13 19:03
tlr

Registered: Sep 2003
Posts: 1790
Quote: Quote:
...sets off a single-shot NMI ... The older 6526 triggers one cycle later

This mean that the IRQ is triggered 1 cycle later, or the timer start to count one cycle later?


Trigger only.

IIRC timer B doesn't double count either, only timer A.
2015-02-13 19:42
Flavioweb

Registered: Nov 2011
Posts: 463
Quote:
IIRC timer B doesn't double count either, only timer A.

Strange...
If this is correct, and no value is "doubled", means that a cycle is lost every countdown.
If i understand your sentence ...
2015-02-13 19:58
tlr

Registered: Sep 2003
Posts: 1790
Quote: Quote:
IIRC timer B doesn't double count either, only timer A.

Strange...
If this is correct, and no value is "doubled", means that a cycle is lost every countdown.
If i understand your sentence ...


to be clear: this is for all revisions of the chip. Timer B doesn't feature the counting anomaly of timer A.
2015-02-13 20:29
Flavioweb

Registered: Nov 2011
Posts: 463
Sorry, you will definitely clear for who knows more than me.
But i can't understand what you mean with "counting anomaly".
Are you talking about the fact that is impossible to read value zero from timers (A in this case) but, instead, reset value is used twice?
Or the meaning is different?
2015-02-13 20:43
tlr

Registered: Sep 2003
Posts: 1790
Quote: Sorry, you will definitely clear for who knows more than me.
But i can't understand what you mean with "counting anomaly".
Are you talking about the fact that is impossible to read value zero from timers (A in this case) but, instead, reset value is used twice?
Or the meaning is different?


That's what I ment, but thinking about it, it may only apply in chained (Timer B counts Timer A) situations.

I fiddled around with it a lot to get make r-load 0.3 working but can't remember the details at the moment.
Anyone has this fresh in memory?
2015-02-13 20:51
Flavioweb

Registered: Nov 2011
Posts: 463
Quote:
it may only apply in chained (Timer B counts Timer A) situations

This make sense now.
I'm pretty sure that both Timer A/B suffer from the "counting anomaly", but making Timer B counts Timer A, CIA could handle "zero" properly...
2015-02-14 12:41
Flavioweb

Registered: Nov 2011
Posts: 463
There is a strange thing i noticed.
I tested this only in Vice, not on RH, but seems if CIA has some problems handling "1 cycle" events.
Now i try to explain.
If we set Timer B to count Timer A with this:
    LDA #%00010000
    STA $DD0E
    STA $DD0F
    LDA #$01
    STA $DD04
    LDA #$00
    STA $DD05
    LDA #$04
    STA $DD06
    LDA #$00
    STA $DD07
    LDA #%01100001
    STA $DD0F
    LDA #%00000001
    STA $DD0E

then $DD06 reaches zero.
But if we set
    LDA #$00
    STA $DD04
    LDA #$00
    STA $DD05

$DD06 never reaches zero, but the "counting anomaly" appears.
This should be in relation with the time taken by CIA to clear and reset the counter: 1 cycle is probably not enough...
2015-03-05 02:14
White Flame

Registered: Sep 2002
Posts: 136
It's been a long time since I wrote that detection code, but this is what I remember:

Between the two CIA versions, if you set a timer for N cycles in continuous mode, both revisions will have that same exact number of cycles between IRQs, but at a 1-cycle "phase offset" compared to the other revision. IIRC, one will trigger the interrupt while transitioning to zero, the other will trigger after it has transitioned to zero. Both count through the same sequence of numeric states internally.

I use this for syncing the NMI to the screen for raster splits and DMA delay, while the IRQ is used from the VIC-II for sprite multiplexing. The same timer values are used regardless of the CIA revision, but which cycle the NMI timer is started depends on the revision.
 
... 3 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Alakran_64
csabanw
Broti/DT/KRN
Yogibear/Protovision
Quetzal/Chrome
Guests online: 92
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.04 sec.