• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by JColvin

  1. JColvin


    Hi 1116345, I am not familiar with FPGAs so I won't be able to completely answer your question, but I do see a few things that will likely need some adjusting. Within your code right after you begin the process(S), you have a line that says I do not think that the "comp2: while ( S(N) = '1')loop ) then" will ever leave here because of the while loop that you have. The reason for this is once S(N) = '1', you never change the value of N so this condition of S(N) = '1' will be true indefinitely. Yes, it is within an elseif statement, but I don't think you will actually get out of the while loop so that you can reach the end of the elseif. Another bit is that I think (again, I'm not familiar with FPGAs) is that you don't have a "then" & "end" associated with the aforementioned while loop. This is probably why you have the two errors that say The final thing that I am seeing is that you have too many "end if" statements. I do not know if they contribute to any of the errors that you are seeing, but after taking a look at hamster's example code on running a stepper motor, the way he uses if's, elseif's, and end if's suggests that you do not need an end if for each elseif. As for the other errors, I personally do not know what the problem might be since I have not coded an FPGA, but hopefully this gives you a place to start debugging your code. Let me know if you have any more questions. Thanks, JColvin
  2. Hi helmutforren, I am by no means an FPGA expert so I can't guarentee this will solve your problem, but did you regenerate your linker script? Apparently, according to this Xilinx post, you need to regenerate the linker script in order to have the new values of 128K be updated. Thanks, JColvin
  3. Hi advisor, Yes, both the CS and the Clk signal lines for the SPI interface will need to be generated by the FPGA board (the "master" board in terms of the SPI protocol). I am not familiar with FPGAs so I can't tell you what the most optimal/simple way of providing these signals might be, but referring back to your question about the PmodDA4, I imagine you can generate those signals in the same way here. Let me know if you have any more questions. Thanks, JColvin
  4. Sweet! Thank you for sharing!
  5. JColvin

    Basys �

    Hi ricardo_lara_gomez, The calculation style would essentially stay the same. The key here is knowing what your motors reported speed is at 12V, which you would be able to find in the datasheet for your motor. Once you find that and apply your 12V PWM signal you can use the same equation to figure out the number of turns that your motor took. (full speed rpm at 12V) * (pwm duty cycle %) * (% of minutes that you are applying a pwm signal) = number of full rotations. Again, as not every motor is perfectly accurate and do not stop and start instantly, this equation will not get you the exact number of rotations, but it will pretty close for most purposes. As for the specifications of the motor, I recommend "googling" the number/letter combination that should likely see on the side of your motor in order to find the datasheet for the motor. Let me know if you have any more questions. Thanks, JColvin
  6. JColvin

    Basys �

    Hi ricardo_lara_gomez, The truthful answer is that there is no "easy" way to count the number of turns accurately on a DC motor because they are not designed to be able to purposefully rotate a specific amount. That being said, what I would consider the easiest would be to determine the approximate maximum rotation speed at its rated voltage from the motors datasheet. After we know that value, we can then calculate the mid-range speeds from pwm pulses of that same rated voltage. For example, if a motor had a rated rotation speed of 125 rpm at 5V, then we could say that if we supplied a 5V pwm signal at a 50% duty cycle (on for half of the time and off for half of the time), this would effectively give us 50% of the rotation speed (62.5 rpm). We could then use a timer of some sort to measure how long we sent the pwm signal to the DC motor. So, if we took our same 5V motor and gave it a 50% duty cycle pwm signal for 24 seconds, we can calculate how many rotations our might have taken. What we would need to do is take the full 125 rpm times the 50% duty cycle times the amount of time we spent driving the signal. 125 rpm * 50% duty cycle * 40% minutes = 25 rotations As nice as this looks though, this equation is not guaranteed to be accurate. If we have any sort of load on the motor (like having the motor act as a shaft to move a robot) or from the fact that not all motors are exactly the same or from the fact that the motor will not instantly stop spinning the moment the pwm signal is stopped, the amount of full turns our motor actually took may be different than what we calculated. However, the equation we made will give you a good estimate of the total number of turns. Let me know if you have any more questions. Thanks, JColvin
  7. Hi bellizima, What do you mean by "images"? Do you mean the pictures in the document? Or the bootloader image? In case you are referring the bootloader images, those are at the bottom of their respective chipKIT product pages on the Digilent website. They will be the documents with a light blue box with a "Fw" in them. Let me know if you have any more questions, Thanks, JColvin
  8. Hi timothyheider, What it sounds like to me is that you have the program loaded onto the CellularRAM on the Nexys 3 which is volatile meaning it will lose any information that it had stored when the board is turned off (or power cycled). What you would need to do if you wanted to keep the program on the board is upload it onto the flash memory onto the Nexys 3, which is non-volatile so it will retain the program stored on there (more or less) indefinitely until you purposefully erase or overwrite it. Unfortunately, I am unfamiliar with FPGA's, so I cannot offer any guidance on how you would write your program to the flash memory as opposed to the CellularRAM. Please let me know if you have any more questions. Thanks, JColvin
  9. JColvin

    Basys �

    Hi ricardo_lara_gomez, Counting the number of complete turns a motor takes will depend on what you have available to you and your application, so I'll need to know a few more things before I can effectively help you. What kind of motor are you using? A DC motor, servo motor, or a stepper motor? Are you using the motor to go both forwards and backwards? Are you wanting the motor to just go at full speed or a variable speeds? Thanks, JColvin
  10. JColvin

    Pmod Ad5

    The bit stream that hamster has provided is exactly what you would want to provide when you want to have the AD5 use a pseudo differential input with pin "A0" on the 6x2 header on the Pmod. When using the pseudo differential input though, you will also need to provide a a voltage reference on the pin "ACOM" on the 6x2 header on the Pmod. Because the Analog Devices chip on the Pmod is by default operating in bipolar mode, and with a gain of 1 as we have configured the Pmod, I would recommend using a voltage reference of 2.5V. As per the "Data Output coding" section on page 33 of the reference manual, bipolar mode will actually only convert the analog signal into 23 bits with the 24th bit (the first one in the string of bits in the acting as the sign bit. This sign bit will indicate if the analog signal you are sending the AD5 is above or below the ACOM reference voltage. It is fairly easy to enable other analog input channels by turning on their bits (such as CH1, CH2, etc in the Configurations register on page 27), but as Mike mentioned, the design can get more complicated as we start needing to read from multiple registers like the Data register and the Status register in order to tell us which channel the information in the Data Register applies to. Let me know if you have any more questions. Thanks, JColvin
  11. These 12 bits most accurately represent the wave amplitude. However, it does not represent the entire wave; just a single part of the wave in a particular point in time. More precisely, the 12 bits that the PmodMIC sends to the system board via SPI represent how much of a full scale signal the system board is receiving. In decimal notation, 12 bits is equivalent to 4096 individual steps. So, if you were operating the PmodMIC at 3.3V, the 12 bits that you would receive would represent what fraction of 3.3V that the microphone is sending out at one particular point in time. Let me know if you have any more questions. Thanks, JColvin
  12. JColvin

    Pmod Ad5

    Hi 1116345, Hamster has given a great explanation (as he always does) on how to get the code for your FPGA up and running, but there are a couple more external hardware things that you'll need to do. The PmodAD5 uses Analog Devices AD7193 to do all of the analog-to-digital conversion. However, this particular chip only takes analog inputs as a differential pair. By default, it expects that you would be pairing AIN1 (A1 on the 6x2 female header) with AIN2 (A2 on the 6x2 female header). It also expects that you supply a reference voltage on the AVDD pin (something between 3V and 5.25V) and a ground reference voltage on the ground pin (0V) that are on header J4. Since you are using a light sensor, you will likely want to change the gain from the default of 128 to a gain of 1 in order to allow your analog input to have a wider range with respect to the analog voltage reference. To do this, you would need to write to the last three bits in the configuration register (pg 27) to 000 in order to have a gain of 1. If your reference voltage (AVDD on header J4) is 5V, this will allow you to have an maximum input voltage of up to 3.75V (from page 32 under Programmable Gain Array). Please let me know if you have any more questions. Thanks, JColvin
  13. JColvin

    Pmod Ad5

    Hi, There are a few things that could potentially be the source of your problem, but I'm not sure quite yet what they might be. So, I have three questions. Did you change/write to any of the registers of the Analog Devices ADC that is on the Pmod? Did you use any external reference voltage? Is it just a single analog signal that you are measuring? Thanks, JColvin
  14. Hi omarniopequeno, I personally don't know how you might implement the module in Verilog (I'm a microcontroller guy), but I do know what the 12 output bits mean. The 12 output bits are what the analog-to-digital converter that is present on the PmodMIC send out which represent the data (sound) that was picked up by the microphone in a particular instance of time. Practically speaking, when the MIC picks up some sound, the sound waves activate a component in the microphone which produces a voltage (analog) signal. This voltage signal is then sent to the analog-to-digital converter that is also on the Pmod, which converts the analog signal into a digital signal, in this case 12 digital signals. Since digital signals are simply just high and low voltages, digital signals can be effectively interpreted as a binary code with a high voltage represented as a '1' and a low voltage representing a '0'. The PmodMIC allows these 12 bits to become available to you (the user/ the basys2 in this case) through SPI (serial peripheral interface) with the most significant bit (the largest binary value) becoming available to you first out of the 12 bits of information. However, because of the nature of SPI, the PmodMIC will actually send you four '0' (low voltage) values first before sending the 12 bits of information through SPI. Please let me know if you have any more questions. Thanks, JColvin
  15. Hi Jordi, That's alright, we all make mistakes sometimes. I am by no means an FPGA expert, so I'll need sbobrowicz to confirm my answer but here is my understanding: After checking out the reference manual for the JTAG-HS3, I believe the reason that this is a pure 14 pin cable is so that the Zynq-7000 chip on ZYBO boards is able to be programmed correctly since that pin (pin 14) needs to be connected to pin 14 of the JTAG header and driven low at the appropriate times. Because the header is a 2x7, the 1x6 connector naturally cannot connect to all 7 pins simultaneously so the board is programmed correctly. That being said, if you are programming a different board that only requires the 6 pins, I would think that in theory you could individually route the signals from the HS3 to the 6-pin MTE connector with wires, although I don't know how this would affect the programming since it's hard to guarentee the wires are the same impedance so that signals pass through at the correct times and whatnot. The main issue, at least from my point of view, is that the pins on the HS3 and a 6-pin compatible cable (like the JTAG-HS1) are not in the same physical location, so you would not be able to plug in the 6-pin MTE connector straight into the HS3 and have it work correctly. Again, you maybe could route the wires individually, but that might result in some iffy programming; I have never personally tried this. Either way, the 14-pin connector is recommend simply because it brings all the signals of the HS3 to the correct pins on the FPGA without any issue or user re-routing. Let me know if you have any more questions. (and correct me if this is not accurate sbobrowicz) Thanks, JColvin
  16. As an additional side note, if you want to use the PmodI2S, you will need to use one of the newer FPGAs as opposed to a chipKIT board. Most of the chipKIT boards, aside from the chipKIT WiFire, are only able to run at 80 MHz which is unfortunately simply not fast enough to generate the master clock signal that the PmodI2S requires in addition to performing other actions (such as sending audio data). In terms of numbers, for those who are interested, the reason for this is because the slowest master clock signal that the PmodI2S can receive (according to the on-board chips datasheet here) is 8.192 MHz, which is equivalent to about 122 ns between clock edges. On the chipKIT boards, with a processor clock rate of 80 MHz, they are are only able to utilize their timer register clock for core services for half the time (40 MHz). This is a difference of 25 ns between clock edges, implying that every 5 clock "ticks" the master clock signal for the PmodIS will need to be triggered. Unfortunately, switching the voltage state of the digital pin driving the master clock and running a counter to keep track of the other needed clocks (such as the LRCK) takes more than 5 clock cycles to complete. This means that once the processor enters an interrupt service routine to "tick" the master clock and increase the counter of the other clocks, it will essentially never leave the ISR since more than 5 clock cycles passed while performing the functions within the ISR.
  17. Thank you for sharing your solution!
  18. Hi Jordi, I believe that particular statement is for the Xilinx 2x7 connector which is for the JTAG-HS3. What they are referring to is the JTAG3, which actually a different product, although I agree that it is a confusingly similar name; it took me awhile to notice the difference. You can see it at the bottom of the programming solutions product page here: http://www.digilentinc.com/Products/Catalog.cfm?NavPath=2,395&Cat=5#JTAG3 Let me know if you have any more questions. Thanks, JColvin
  19. JColvin

    Analog Shield

    Strictly speaking and for practical purposes, it is not compatible with the Arduino Mega. It was designed for the Arduino Uno and the chipKIT Uno32, so while the shield would be able to physically connect to the Mega, signals that the IC's present on the Analog Shield are expecting to receive are mapped to different pins than what the shield would actually connect to. Let me know if you have any more questions. JColvin
  20. Hi, I am personally not familiar with Linux so I do not know if this is the best answer to your question, but one of the other users on the Digilent Forum explained how they were successfully able to run Waveforms on the Linux machine. You can check out the forum thread ).
  21. Hi, The WS2812 LED Strips were not made directly by Digilent from the ground up (so-to-speak) so we not developed a nice Digilent documentation for it as of yet. However, we have made links on the product page to two different Instructables that explain how you would get the LED Strips up and running on either a chipKIT uC32 or Uno32 ( well as the chipKIT WF32 or Max32 (http://www.instructables.com/id/Getting-Started-with-WS2812-LEDs-with-Digilent-chi/). Additionally, you can check out our blog post on the WS2812's (https://blog.digilentinc.com/index.php/new-product-ws2812b/), which explains how to recognize which LED Strip you have, how to power the LEDs, and communicating with LEDs. On the blog post we also recommend two more tutorials on running these LEDs by Phillip Burgess from Adafruit and from arcobotic on Instructables. Please let us know if you have any more questions.
  22. Hi ulvarg, I am personally not very familiar with FPGAs, but I will do my best to respond to your question. Naturally, I do not know you your current familiarity with FPGA's, so it is somewhat difficult for me to appropriately address your question within a single response. However, I do have two recommendations to help you get started. My first recommendation, which I strongly suggest, is checking out Digilent's learn site. Digilent offers free Learn Modules to help users, such as you and I, get started with projects using Digilent products, such as the Nexys 4. These are available at learn.digilentinc.com with a full list of projects that are currently available here. Within that list, you can click on the "Digital/FPGA" tab to view all the projects related to FPGA's ranging from just getting started with FPGAs to creating your own state machine. Also, one of our forum members has shown another user how they might get a DC motor started using a Basys 2 board. Granted, this is not a Basys 3 or a Nexys 4 board, but the implementation concepts for an FPGA will be similar. You can view the post
  23. From my understanding, that will work just fine to program the boards separately and connect them together later so that they can communicate. Please let me know if you have any more questions. Thanks, JColvin
  24. Hi kpparr, If you are only communicating between the Pmod headers, you should be able to power each of your boards from their own USB connector and attach them both to the same PC. As long as your boards aren't drawing a ton of current (which from your description sounds like you won't even be coming close to limit), this should not be an issue. I have done a similar project with two Digilent microcontrollers and powered them both from my laptop without any problems. Alternatively, you could program one (or both) of your FPGAs to ROM and use an external wall power supply to power your boards. However, I would not recommend trying to power one board off of the other board. I think going from J5 to J5 would result in too much of a voltage drop to successfully power both boards if you are powering the first board from a USB port. It may work if you were instead using an external power supply, but I would personally power the boards separately. I believe the Pmod Vcc is only able to output at 3.3V, so that is not within the required input voltage range of 4.5 - 5.5V (ideally 5.0V) that a Basys 2 board needs to operate. So in the end, I recommend powering the two boards separately. Let me know if you have any questions. Thanks, JColvin
  25. Hi Alex, The technical reference manual for the Analog Discovery, which lists the tolerance for its various pins, can be found on it's product page here (http://www.digilentinc.com/Data/Products/ANALOG-DISCOVERY/Discovery_TRM_RevB_1.pdf). Alternatively, they also check out the most up to date reference manual on the Digilent Wiki here (https://reference.digilentinc.com/analog_discovery:refmanual) Let me know if you have any more questions.