• Content Count

  • Joined

  • Last visited

Everything posted by DerekM

  1. Spotted the issue by looking through your code; I just needed to enable the OSC_EN bit of the GENERAL_CFG_B register (0x4D). Column lines are driven low as expected now, and the row/column lines are switching correctly for key presses. I can carry on with the rest of my code now. Thanks a million for your help, really appreciated! Regards, Derek.
  2. Thanks for the reply Jon. Your set-up looks very similar to mine (all-be-it I have a different platform i.e. the RPi, but that's only related to the I2C comms which I know is working on my set-up), so this is promising. I'll look through the MPIDE code and try to reverse-engineer it for my purposes. I'll post back if I can get this working (or not). Derek.
  3. Hi, I'm currently having some trouble in getting the PmodIOXP and PmodKYPD to play well together. Separately, I have no issues in running either Pmod in a standalone fashion e.g. I can run the PWM output on the PmodIOXP with no issues, and I can drive the PmodKYPD correctly using the GPIO outputs of a Raspberry Pi. So I know there are no problems with either Pmod. However, when I connect the KYPD to the IOXP (via J1) and configure the IOXP for what I think is correct KYPD use, the column lines never go low as is standard for matrix switch operation. This means key presses cannot be detected by
  4. Apologies for the delay in replying. Yes, I've checked out loads of relevant Digilent code and they all indicate that the encoder rate is 3 pulses/revolution. But I am convinced that on the 1:19 motor I have, the rate is 1 pulse/revolution. From some datasheets I found, I think that this particular motor comes with a rate of 1 or 3 pulses/rev, so perhaps I just happen to have the model that does 1 pulse/rev. It's not a big deal at all though, don't feel like you need to follow up on this. But I would be interested if someone else thinks the rate on their 1:19 motor is 1 pulse/rev, just for my
  5. No problem. I'm happy that I have the direction issue sorted, but after some experimentation I'm not convinced that the encoder is outputting three pulses / revolution. I've set the motor running really slow (60RPM), and I can obviously count the revs at this speed (and indeed there are 60revs/minute). But on the scope I can see the sensor outputs also running at about 60Hz, which indicates one pulse / revolution. If it was three pulses/rev I would expect a frequency of 180Hz. Also, when I run the motor with regular settings (say, 2kHz with 50% duty-cycle), the sensor frequency is about 5
  6. Thanks, that makes sense now as regards the direction (active-low for CW, not active-high as I thought). Just fyi, it was this page that confused me. It says "To drive the motor at a specific speed, users will need to choose a static direction (forwards or backwards corresponding to high or low voltage) on the Direction pin", which I took to mean high = forward direction. Also, I think the block diagram for the PmodHB5 circuit on that page shows an incorrect mapping for M+/M- (M+ should be pin 5, M- should be pin 6). That also added to my confusion as regards direction. Thanks again for t
  7. A couple of questions/comments on the PmodHB5 and 1:19 Gear Motor combination, which I've been playing around with: 1. Is the motor direction being set correctly? It looks like when you set the DIR pin to high so that the motor will spin in a forward (CW) direction, the motor actually spins in a CCW direction rather than CW. Also, if you check the Sensor A and Sensor B signals in this case, it looks like Sensor B signal leads the Sensor A signal by 90 degrees, again indicating a CCW direction. Possibly I'm misinterpreting something here, but can you please clarify that the direction is be