• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by JColvin

  1. Hi, Having worked with the PmodDA4, I believe I know what issue you are running into, but please correct me if this is not the case. You are correct in that the update DAC address command is 0011 and that the value for all eight outputs is 1111. However, the on board DAC assumes by default that it is using an external voltage reference on one of its pins. Since it rather inconvenient to use an external reference voltage for the chip, what you will need to do is send a command to use its internal reference voltage of 2.5V. This 32 bit message you will need to send in four 8 bit chunks is 00001000 00000000 00000000 00000001. You can see the data sheet reference for this command on pages 24 and 25 for the DAC (http://www.analog.com/static/imported-files/data_sheets/AD5628_5648_5668.pdf) Let me know if you have any other questions. Thanks, James
  2. Ah. Presuming that your output is performing as desired, then the reason your motor is not rotating is because you are trying to rotate it to quickly. The fastest that I was ever able to rotate the stepper motor was about 60 rotations per minute or about 1Hz. You may be able to get the motor to rotate quicker by using a larger voltage signal, but it will get nowhere near the 400Hz that you are wanting. The only way that I know to fix this is to get a new stepper motor that is capable of rotating that quickly. Unfortunately, I don't personally know of a stepper motor off the top of my head which is capable of that speed; I believe there are motors that can go that quickly, I just don't know which ones can.
  3. JColvin

    DVI Receive on Zybo

    Hi vadim, Actually, would you mind if you summarized your answer here on the forum? That way other people who encounter the same issue but need a little more guidance on how to resolve the problem can find out here. You don't have to if you don't want to though. Thanks, James
  4. Hello! I have made an Instructable on how to use a stepper motor in unipolar mode. The code is specifically designed to run the stepper motor with a chipKIT board, but the general principle of how the stepper motor is run can be applied to any system board. You can check it out here. Thanks, James
  5. Hi, I chatted with you earlier today, but I am putting a condensed reply here as well. If you are using a 5 wire stepper motor that looks like this one in the picture link below: http://www.instructables.com/file/FF7YQ75I0XOISBQ then the way that the wires are arranged are follows: The orange wire corresponds to coil 1the yellow wire corresponds to coil 2the pink wire corresponds to coil 3the blue wire corresponds to coil 4and the red wire corresponds to the center taps on the two sets of coils. You can connect the four coils to the pins on the PmodSTEP as well. If you are connecting to J2 (the four pin connection), I would recommend attaching the orange wire to pin 1, the yellow wire to pin 2, the pink wire to pin 3, and the blue wire to pin 4. The red wire should be left floating in this case. These four pins (1, 2, 3, and 4) are associated with the pins 7, 8, 9, and 10, respectively, on the 6x2 pin header. To run the stepper motor in this configuration (bipolar mode) you will need some way to get current flowing through the electromagnetic coils in the reverse direction. This can be done by either having a board that can output both positive and negative voltage signals, or by using an H-Bridge. Alternatively, you can also connect the 5 pin stepper motor to pin header J3 on the PmodSTEP. Here, I would recommend attaching the orange wire to pin 1, the yellow wire to pin 2, the pink wire to pin 5, and the blue wire to pin 6. The red wire can be attached to either pin 3 or pin 4; it does not matter which one you choose. The pins 1, 2, 5, and 6 on J3 are also associated with the pins 7, 8, 9, and 10, respectively, on the 6x2 pin header. To run the stepper motor in this configuration (unipolar mode), all you need is to have your board produce a positive voltage signal and a ground signal; no H-bridge will be required. You can learn how unipolar mode works in principle by following my Instructable here. Please let me know if you have any other questions.
  6. JColvin


    Hi cmeuchel, I believe I have found the source of your original problem. The issue that you are running into is with the fact that the analog.read() function returns an unsigned 16 bit value. However, you have count declared as an "int" meaning it is a signed (+/-) value. Therefore, because you are assigning an unsigned value to a signed value, the most significant bit (the largest value which accounts for all of your higher voltages) is no longer interpreted as a number, so-to-speak, but as a minus sign, messing up any attempts to correctly interpret the value. So, when you are reading the 0V, the analog.read() function will return a value slightly larger than 32767, such as 32842 (greater by 75). However, because the highest bit is interpreted as a negative sign instead of a '1' for the binary number, the C language sees the first number of the extra 75 as the negative sign (to make it -32767) and the remaining 74 out of the 75 extra as additional values making the final value which you printed -32693. (-32767 + 74 = -32693). With the even higher voltages, this negative value will continue to get closer and closer to a value of '0'. The easiest way to fix this is to simply declare your variable count as an unsigned integer: unsigned int count = 0;This will fix your count value at higher voltages. I also spotted one other issue with your map() function. The second and third parameters for your map function are the min and max values, respectively, that you are expecting to be getting from the value you want to "scale" (count in this case). However, as the analog.read function only returns unsigned int values between 0 and 65535 (with the zero value corresponding to -5V and the 65535 value corresponding to +5V) so you will never be giving the map function that lower bound of -32767. So, there are a couple of ways to fix this, which you have already done to an extent, but I'll list them anyway for the sake of explanation. One is when you calculate your voltage from your analog.read value use the voltage = count * (10.0 / 65535.0) - 5;equation in order to account for the fact that the 0 to 65535 range that analog.read gives is associated with -5V to +5V (a 10 V range). The -5V will then get the voltage back to the correct polarity. You would then also want to change the map function to say val = map(count, 0.0, 65535.0, -5.0, 5.0); Alternatively, if you really wanted to keep the -32767 and the 32767 as the 2nd and 3rd values in your map() function, you could subtract 32767 from your "count" variable before giving it to the map() function. count = analog.read(0) - 32767; val = map(count, -32767.0, 32767.0, -5, 5);This will then "map" your count to the -5V to 5V scale that the analog.read() function is working off of. Let me know if you have any questions. Thanks, James
  7. To get the UART working on the PmodMAXSONAR you need to connect the "RX" pin on the Pmod to the "RX" pin to the microcontroller. To find out what pin that is, you need to go to the "Board_data.c" file for your microcontroller (NOT the board defs file that the MAXSonar library suggests). To find this file (since the library doesn't tell you where it is) you need to open up the original mpide folder when you first installed mpide. Mine is called "mpide-0023-windows-20130715", so yours likely has a similar name. Within this folder, open up the "hardware" folder, then the "pic32" folder, then the "varients" folder, and then find whichever microcontroller board you happen to be using and open up the "Board_data.c". Since the demo code is using the Serial port 1, this means we are using UART2. So, search the document (via Control+F or Command+F or whatever is appropriate) for "U2RX". The associated number with the U2RX is the pin that we need to define the RXpin as in the demo code and the pin we will connect the RX pin from the PmodMAXSONAR to. Let me know if you have any questions. Thanks, James
  8. Hi, How do you get the UART mode on the PmodMAXSONAR to work correctly? While using the provided demo code, I am able to get the PWM and Analog modes to report correct distances, but I seem to be having trouble to get the UART version to work. What pin(s) should I be using? Thanks, James
  9. Hi Sharon, Thank you for that catch! We'll get it fixed as soon as we can. Thanks, James
  10. Hi J&W, From my understanding, the short answer is yes, you will be able to use the PmodRF2 with the Basys2 board to send and receive text. This is because, from a "high-level" point of view, the Pmod will communicate with the host board (the FPGA in this case) using high and low voltage signals. The reason the reference manual indicates that the PmodRF2 should be used with microcontrollers is because the associated software stack (I think) handles the all of the checking for radio signals, controlling power consumption, and dealing with all of the addresses on the chip. That being said, it is possible to create code for the Basys2 that essentially mimics SPI (at least that is my understanding of how FPGA coding works) since the FPGA is just talking directly with the Pmod, not directly the second Basys2. You could then have the FPGA transmit values that write (via high and low voltage signals) your data to the appropriate transmit register in the MRF24J40 chip present on the Pmod and also read data from the receive register that is in the chip. Having never really dealt with wireless communication of any kind, I will be honest in saying that this sounds like a lot of work in getting the communication up and running. But from what I understand, this is the case for any kind of wireless communication; radio frequency, bluetooth, WiFi or otherwise. So, as the Pmod Guy, the answer to your question is yes, it is possible to use the PmodRF2 with your Basys2 boards to send messages to its twin board. Please let me know if you have any more questions, and I will do my best to find out. Thanks,James
  11. After doing a bit of research, I found out what the 5th wire (the red one), could be used for. The Stepper motor claims it needs to use 5V, so if you hooked up the stepper motor inputs to a Darlington Transistor array, when you drive a particular input HIGH on the microcontroller, the Darilington Transistor will bring that particular output to a LOW state, which will encourage current to be drawn. Since stepper motors work by electromagnets, when we are driving a particular magnet low, this means that the rotating motor shaft itself will need to be at a HIGH state so that it is a "magnetic opposite" to the "on" electromagnet. Basically, this means that the 5th wire on the stepper motor will need to be attached to a 5V line in order to have the motor work. This also gives it a lot more torque than I was seeing before and allowed me to get about 48 revolutions/min. As for connecting to the PmodSTEP, an external connector will need to be used. The PmodSTEP only accounts for the popular 4-wire (a purely bipolar stepper motor) and the universal (bipolar and unipolar) 6-wire stepper motor. The 5-wire stepper motor in the chipKIT Starter Kit is actually a 6-wire stepper motor; however, the two central taps to the coils are internally tied together to create a 5-wire header.
  12. I eventually found in the Analog Devices datasheet the structure of the 32 bits of information, but it still wasn't working until I realized (by combing through the datasheet some more) that I needed to set up the internal reference voltage for the chip since it normally checks for an external reference voltage by default. So, to help avoid any further confusion, I made an Instructable on how to (successfully) use the PmodDA4 here. Let me know if you have any questions. Thanks, James
  13. What I found is that while both of these Pmods support motor feedback from Hall Effect sensors (or some other kind of feedback), the PmodHB3 presumes that the feedback sensor is not incorporated into the motor itself but is rather an external sensor. So, the two motor feedback pins, SA and SB, are on their own header (J5) on the Pmod. On the other hand, the PmodHB5 presumes that the feedback sensors are incorporated into the motor itself and have their signal wires on the same wire header as the motor outputs present on the J2 header. Otherwise, the two Pmods are functionally the same.
  14. I noticed the PmodHB3 and the PmodHB5 seem to be really similar in both their schematics and reference manuals, so I wanted to know what the difference between them was.
  15. I have a question (not surprisingly) about the stepper motor that comes in the chipKIT Starter Kit (28BYJ48A). I know that I'm supposed to pulse the four lines to make the electromagnets "turn on" in such a way to make the motor turn one way or the other. I did so by driving various I/O pins on the chipKIT uC32 high and low and got it to rotate, but it seems I can only get it to rotate up to a maximum speed of ~12 revolutions/min, since any shorter delay than 3 ms between driving the magnets high/low seems to make the electromagnets shift around faster than the motor can keep up. My other question (which I'm honestly more curious about) is what the 5th wire for on the header for the stepper motor? According to this website, that wire should be hooked up to a 5V line, but when I hook that line up to 5V (or 3.3V or ground) the motor shaft stops rotating; I'm only getting it to rotate when that 5th line (the red one) is floating. So... should I be seeing this? Thanks, James P.S. How would I hook up this 5 pin header to the PmodSTEP? The PmodSTEP only has 4 and 6 pin headers so the 5-pin header from the stepper motor physically doesn't fit.
  16. My name is James and I am one of the interns here at Digilent and am currently working to become a Pmod expert and will be happy to help you out with any difficulties you might be encountering.
  17. Hi LariSan, Could you provide the link to where the promo video is located? Thanks, James Colvin
  18. Hello! If you have ever used something that produced sound through a speaker, than you have indirectly used a Digital-to-Analog Converter, or DAC for short. Many tutorials on how to use a DAC will cover how to use a R-2R resistor ladder which is one of the popular ways that DACs are constructed. However, not very many explain how you might use a DAC that is already created in a small IC chip, such as the one present on the PmodDA4. But no more! You can learn more about DACs in general from the Digilent Blog as well as how to use an IC DAC from this Instructable.
  19. Hello! When you connect two different electronic components together, they need to follow some sort of communication protocol so they are successfully able to talk to each other and operate correctly. One of the popular communication protocols that is used in the electronics industry is SPI. You can learn about the theory and how to implement SPI in code from this Learn Module as well as this Instructable.
  20. Hello! Some of you may have wished there was a way to conveniently store data that you were collecting without having to declare individual variables for every piece of data. Arrays are a great way to solve this dilemma. You can learn more about arrays and how to use them from the Digilent Blog, this Learn Module, and this Instructable.
  21. Hello! 3D modeling is a cool application that has been around for awhile that allows people to create, well, 3D models of nearly anything they like. Sadly, some of the better 3D modeling programs aren't as immediately user friendly as some of the simpler programs, so it can take awhile to learn how to use them. Blender is a powerful open source 3D modeling software program that falls into this category. I personally find 3D modeling to be super fun, so I made an Instructable on how to use some of the modeling functions that are available in Blender. You can check it out here as well as on the Digilent Blog.
  22. Hello! There are a lot of fancy thermometers out there, but not all of them are very convenient for creating with your microcontroller or FPGA on your tabletop at home. However, thermistors, a type of resistor that changes resistance based on the temperature, are very easy to use and can be implemented into your own digital thermometer. You can find out more by checking out the post in the Digilent Blog as well as the Learn Module for how to make a digital thermometer.
  23. Hello! Soldering is a very commonly used technique to create circuit boards and connect other electronic components together. However, there isn't just one soldering iron that everybody uses. Like many tools, there are different tools, or in our case soldering iron tips, that are ideally suited for different types of jobs. You can learn about some of the different types soldering iron tips that are out there from the Digilent Blog as well as the popular Instructable.
  24. Hello! Many of you have likely seen PWM in action: it is commonly used to drive motors as well as making LEDs look like they are "breathing". You can learn how it works and how to use it in code from both this Learn Module and this Instructable.