+mytek Posted September 24, 2020 Share Posted September 24, 2020 5 hours ago, candle said: this lead me to the conclusion it must be syncing up to the overflow, and then use monothonic property of this counter whenever there is a diffrence in internal counter value vs monitored pins, state machine is reset and resynced, so frequency doesn't matter Yes this would certainly work if you have an I/O pin on the PIC with edge state change interrupt capability. If not, then constant polling would be required to do the same thing , which would be difficult at best to maintain accuracy of the count. As I already mentioned, I didn't have this interrupt option available on the I/O pin assignments that had previously been established in the TK-II standard design. So I used the next best thing that was available, a built-in timer interrupt that could be run at a multiple of the original Pokey key scan frequency. Using this method allowed the new firmware to still work in the previous hardware that looked at the entire K0-K5 counter directly for it's comparison. There is nothing wrong with this approach when one assumes that the Pokey key scan frequency will always be the same. And of course it always is, and has been for 40 years. Because Pokeymax a relative new comer changed the rules, the key scan frequency is now different than the estabished standard. Quote Link to comment Share on other sites More sharing options...
candle Posted September 24, 2020 Share Posted September 24, 2020 i can tell you already, that my AKI interfaces also do not work with pokeymax, thus the only remainig explenation is that pokeymax counter output is not monothonic can't say anything more since i don't have pokeymax to test, i must relay on someone has both pokeymax and my aki interface to do tests for me Quote Link to comment Share on other sites More sharing options...
foft Posted September 24, 2020 Author Share Posted September 24, 2020 Perhaps I count in a different order? The state machine does a tight loop: write value, read value. So should be equal periods and read about mid cycle. In terms of fixes: I think I can do repeated writes really fast, since the command and address do not need repeating. Then an interrupt on kr1/2 change. The problem is I’d then need to stop the counter while I read the kr1/kr2 values. If the count is being guessed then I can’t stop it. The other option is to overclock the io expander. It’s spec is 400KHz but in tests (at least one) works reliably up to 3.5MHz. That would allow it to work at the same frequency. As for long term reliability impact, I expect it won’t make too much difference but... hard to know. Anyway I’m going to look at pokey on the scope and see what I can do. @mytek: Many thanks for offering to send me a tk2. Would be great though I’m not sure how to solve the international shipping. I have relatives there but they are clearly not travelling these days. Quote Link to comment Share on other sites More sharing options...
candle Posted September 24, 2020 Share Posted September 24, 2020 stops/starts doesn't matter, frequency of scan can vary, or can be held and resumed, but if scanning order is not like the genuine chip it won't work Quote Link to comment Share on other sites More sharing options...
foft Posted September 24, 2020 Author Share Posted September 24, 2020 On the CO12294-22 its scanning at constant rate ~64.3uS each code. On the CO12294-22 its a plain upward counter. i.e. k0 is bit 0, k1 is bit 1 and goes 00,01,10,11 etc. Pokeymax is scanning at the moment at 182uS each code. ~3 times slower. i.e. 11ms to scan keyboard vs 4ms with C012294-22. Pokeymax is also scaling with not(bincnt_reg) i.e. 11,10,01,00. I should have checked rather than reading active low on wikipedia ? So a first cut to work with AKI would be to change the not(bincnt_reg). Then I can improve the speed (for keyboard gamers 7ms can be serious!) by doing constant writes to the io expander and briefly pausing it on an interrupt that KR1/KR2 changed. As for TK2, hmmm. Quote Link to comment Share on other sites More sharing options...
+mytek Posted September 24, 2020 Share Posted September 24, 2020 3 hours ago, foft said: As for TK2, hmmm. If you can match Pokey's speed as you mentioned, then it might work ok. Is it possible to update the Pokeymax core by the user? I have a USB Blaster if that'll work. Where can I purchase a Pokeymax that can ship to the US? Quote Link to comment Share on other sites More sharing options...
candle Posted September 24, 2020 Share Posted September 24, 2020 reading "low" is partially true, since counter values vs scan codes are inverted/negated still, counter counts upwards Quote Link to comment Share on other sites More sharing options...
foft Posted September 24, 2020 Author Share Posted September 24, 2020 35 minutes ago, mytek said: If you can match Pokey's speed as you mentioned, then it might work ok. Is it possible to update the Pokeymax core by the user? I have a USB Blaster if that'll work. Where can I purchase a Pokeymax that can ship to the US? I will have to overclock to match the speed, I might make that an option. Will experiment tomorrow. Yes the (advanced) user can update the core. In fact it can be done from software on the atari as well as the usb blaster. 3 Quote Link to comment Share on other sites More sharing options...
candle Posted September 24, 2020 Share Posted September 24, 2020 how about debouncing circuitry? can it be disabled to read multiple keys pressed at once as on real thing? and why there is a i2c expander used when you have 169 ball device? i'm just curious about various design decisions Quote Link to comment Share on other sites More sharing options...
foft Posted September 24, 2020 Author Share Posted September 24, 2020 I couldn't get continuous i2c writes working for some reason, the pins did not change. ie. write address command then a stream of data bytes. However I got this working: i) write until kr1/kr2 changes (which causes interrupt) ii) read, register kr1/kr2 This doubles the scan speed just leads to a delay when the key is detected. Scan speed is now ~78uS. i.e. 5ms to scan whole keyboard. So even without ps2 adaptors it was worth doing this ? I fixed the inversion, so the order of k0-k5 updates is correct. So I _guess_ AKI will work with this version. Quote Link to comment Share on other sites More sharing options...
foft Posted September 24, 2020 Author Share Posted September 24, 2020 1 minute ago, candle said: how about debouncing circuitry? can it be disabled to read multiple keys pressed at once as on real thing? and why there is a i2c expander used when you have 169 ball device? i'm just curious about various design decisions Debouncing should work as the original, I didn't test this much though... Really it was down to space on the device for level converters. The io expander is super small and can input/output 5v. I used it for pots too on v1, but it was too slow for arcade switch use. I was trying to get it the size of a real pokey chip, 2 layer board and nothing on the underside. So pretty tight. Quote Link to comment Share on other sites More sharing options...
candle Posted September 24, 2020 Share Posted September 24, 2020 like this? Quote Link to comment Share on other sites More sharing options...
Mr Robot Posted September 24, 2020 Share Posted September 24, 2020 8 minutes ago, candle said: like this? Where can I buy that? Quote Link to comment Share on other sites More sharing options...
foft Posted September 24, 2020 Author Share Posted September 24, 2020 11 minutes ago, candle said: like this? yeah Quote Link to comment Share on other sites More sharing options...
candle Posted September 24, 2020 Share Posted September 24, 2020 mr robot, this is only a prototype Quote Link to comment Share on other sites More sharing options...
Mr Robot Posted September 24, 2020 Share Posted September 24, 2020 I was just pointing out the big difference between it and pokeymax Quote Link to comment Share on other sites More sharing options...
candle Posted September 25, 2020 Share Posted September 25, 2020 this was intended as just pokey replacement (stereo - maybe), no enchancements whatsoever, thus its size for feature-rich product you need to buy either a pokeymax, or simplestereo v4 2 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted September 25, 2020 Share Posted September 25, 2020 I am interested in 1,2 or maybe 3. What is the cost of the best version? Quote Link to comment Share on other sites More sharing options...
+MacRorie Posted September 25, 2020 Share Posted September 25, 2020 (edited) 15 hours ago, candle said: this was intended as just pokey replacement (stereo - maybe), no enchancements whatsoever, thus its size for feature-rich product you need to buy either a pokeymax, or simplestereo v4 If it is a POKEY replacement and is at a good price point, I would buy at least 25. EDIT: it would have to be a 100% drop in replacement in both form and function. If it did that, 25 would only be the beginning. Edited September 25, 2020 by MacRorie Add specs 1 Quote Link to comment Share on other sites More sharing options...
foft Posted September 25, 2020 Author Share Posted September 25, 2020 55 minutes ago, MacRorie said: If it is a POKEY replacement and is at a good price point, I would buy at least 25. EDIT: it would have to be a 100% drop in replacement in both form and function. If it did that, 25 would only be the beginning. Best to contact Duddie directly for orders Quote Link to comment Share on other sites More sharing options...
Duddie Posted September 27, 2020 Share Posted September 27, 2020 PokeyMAX is available in various versions directly from me. If anyone is interested, please contact me via PM. 1 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted September 28, 2020 Share Posted September 28, 2020 Are any demos written for it yet? Quote Link to comment Share on other sites More sharing options...
foft Posted September 28, 2020 Author Share Posted September 28, 2020 So far: sid player (mono) psg player (mono) stc player (mono) sid player (xxl) midijoy - PSG, quad pokey and Sid (freetz) 4 Quote Link to comment Share on other sites More sharing options...
foft Posted September 28, 2020 Author Share Posted September 28, 2020 I guess we need to make a multi chip tracker to get the best from it 4 Quote Link to comment Share on other sites More sharing options...
Kyle22 Posted September 29, 2020 Share Posted September 29, 2020 When I see a multi-chip tracker, I will order one (or two). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.