• Content Count

  • Joined

  • Last visited

About DerekM

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  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 the IOXP. The register settings I use on the IOXP are as follows (Am I missing anything?): PIN_CONFIG_A 0x49 = 0x0F. PIN_CONFIG_B 0x4A = 0x0F INT_EN 0x4E = 0x01 These seem to be the main settings I need. I've played around with other settings such as pull-ups to no avail. The only thing I can think of from a hardware point of view is that because there are 10K pull-ups on the PmodKYPD, it may mean that in conjunction with the 300K internal pull-ups of the PmodIOXP (giving an effective resistance of ~9K) the column lines will not pull down properly to a logic low level. Can you please confirm? I could take the 10K resistors off the PmodKYPD to confirm this theory, but would rather some feedback before I hack the module. (Also, I'm clutching at straws regarding the pull-ups, as from reading the ADP5589 datasheet, I think an effective 9K pull-up resistance should be fine. But I can't be sure).
  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 own sanity! Regards, Derek.
  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 550Hz, which is quite close to the rated RPM of the motor. So again I seem to be getting 1 pulse / revolution of the motor, not three. I may be misinterpreting something here though, as I don't have much experience with motors or encoders.
  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 the reply.
  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 being set correctly (i.e. logic high for CW direction). 2. Regarding the encoder signals Sensor A and B, can you clarify the number of pulses / revolution? From the documentation and example code, It seems to be three pulses / revolution: can you clarify? Thanks.