0 Members and 1 Guest are viewing this topic.
Thanks, Gerald Actually, it did not help, but while adding the resistor net, I did realize I have completely ignored blocking capacitors. I have added one 470uF across the PS/2 keyboard power, and 100nF across the ATTiny and HCT138 power pins.Now one key press generates just one letter on the screen, however, it's a wrong letter: F produces D, B produces C etc etc I believe I have shifted the keyboard rows by one. Could you possibly tell me what AY pin should go to what ATTiny pin? The CPC schematics I have uses X1-X8 for the AY pins, while your schematics uses X0-X7. I assumed AY X1 corresponds to your X0, but it doesn't seem to be the case. Thanks!
Thanks, Gerald. I am reasonably sure the connection corresponds to the schematic, but just in case:PPI pin 14 goes to ATTiny pin 2PPI pin 15 goes to ATTiny pin 3PPI pin 16 goes to ATTiny pin 8PPI pin 17 goes to ATTiny pin 9Is that correct?
static void UpdateKeyboard(void) __attribute__ ((always_inline));
Thanks again, Gerald!I have found better CPC schematic and I agree with you, it looks like the row mapping is wrong. I am constantly getting keys from the next row.(In my schematics, rows are coming from the 74145 decoder while colums are going to AY).I have reviewed the source code and my recompiled binary, and I can see that UpdateKeyboard isn't inlined, which is most likely the problem. As CPC scans the keyboard row by row, ATTiny spends too much time processing the interrupt, and outputs the value too late. That means that CPC will pick the value up when reading next row.I suggest to add the following line before the UpdateKeyboard function:Code: [Select]static void UpdateKeyboard(void) __attribute__ ((always_inline));That should increase the chance that compiler will actually make the UpdateKeyboard inline.I didn't test this on a real hardware yet - programming my adapter is a bit complicated (due to SMD components), but I believe this will fix the problem. Sorry for bothering you with that, it was my fault... but at least we can prevent others from doing the same mistake
Page created in 0.097 seconds with 33 queries.