Forum Discussion
VHDL robot design not working
Hello everybody I'm new in VHDL and I'm doing a project with DE2 board
In the project I need to build a robot. My first step was to design a ASM and from that to take out the FSM which i did (hopefully I did it good enough) The second step is to check one of my ASM and I choose my engine control ASM I wrote a program in VHDL using quartus and burn it into my board Instead of using the motors from the beginnig the idea was to used the board's led using a PWM generator that will create a "running led" effect for a curtain direction and in change it in a push of a button but it didn't work. Can anybody tell me what I did wrong? I think it's in the pin assignment34 Replies
- Altera_Forum
Honored Contributor
I can't really help you if I don't know what went wrong with your code
I can tell you the steps that I had made in order to create a working code 1. Understand your goals 2. Pick your components according to your goals 3. Understand how the components works 4. Create asm 5. Design a logic circuit 6. Write it in vhdl Hope it was helpful - Altera_Forum
Honored Contributor
--- Quote Start --- Hello everybody I'm new in VHDL and I'm doing a project with DE2 board In the project I need to build a robot. My first step was to design a ASM and from that to take out the FSM which i did (hopefully I did it good enough) The second step is to check one of my ASM and I choose my engine control ASM I wrote a program in VHDL using quartus and burn it into my board Instead of using the motors from the beginnig the idea was to used the board's led using a PWM generator that will create a "running led" effect for a curtain direction and in change it in a push of a button but it didn't work. Can anybody tell me what I did wrong? I think it's in the pin assignment --- Quote End --- Hi there I am very new in VHDL I want to write a code for line following robot , but I faced a lot of problems because I started from zero. I spent already more than two months to learn it. when I started to write the code I got stuck and I couldn't know how to start. I tried to check from the internet but I didn't find any thing, then I found your code for robot using VHDL. could you please help me with that if you have done it successfully - Altera_Forum
Honored Contributor
I attaching me designs just in case they are a bit different by now but they could deliver the general idea
- Altera_Forum
Honored Contributor
thanks you helped me a lot
- Altera_Forum
Honored Contributor
I compiled your code and looked at the rtl veiwer (tools -> netlist viewers -> rtl netlist. This shows you the logic derrived from your code). When I saw all the logic had dissapeared (except for latched versions of the input for the leds) I knew something was up because theres nothing wrong fundamentally with the code. I then worked out that 1s/20ns is 50mil, and realised counter, at 17 bits, was not enough to cover 50mil. Because Quartus knows this too, it removed all the logic dependant on it because it never does anything.
changing the counter length wont do much other than increase the number of registers used. It will work fine. - Altera_Forum
Honored Contributor
first thanks.
second how did you come to that from the warrnings third is it good design to change the counter? - Altera_Forum
Honored Contributor
its because the counter signal is only 17 bits, and so not big enough to count to 50million. The synthesisor knows it can never reach 50million, and removes all the logic. You would need 26 bits for that.
- Altera_Forum
Honored Contributor
i just changed the generic time from 100 ms to give the led longer delay
Entity Pwm is generic ( DC : time:=1 sec; clock_period: time:=20 ns ); - Altera_Forum
Honored Contributor
that sounds like you've modified the code and removed the clock, or done something that means you're not creating a proper register.
- Altera_Forum
Honored Contributor
1. Warning (10631): VHDL Process Statement warning at Pwm.vhd(37): inferring latch(es) for signal or variable "Led", which holds its previous value in one or more paths through the process
2. Warning: Output pins are stuck at VCC or GND Warning (13410): Pin "Led[0]" is stuck at GND - for al of the code pins 3. Warning: Design contains 6 input pin(s) that do not drive logic Warning (15610): No output dependent on input pin "Rst" 4. Warning: Found 9 output pins without output pin load capacitance assignment Info: Pin "Led[0]" has no specified output pin load capacitance -- assuming default load capacitance of 0 pF for timing analysis 5. Warning: The Reserve All Unused Pins setting has not been specified, and will default to 'As output driving ground'. 6. Warning: No paths found for timing analysis