summaryrefslogtreecommitdiff
path: root/2004/n
diff options
context:
space:
mode:
authorgalmes2004-04-17 12:27:37 +0000
committergalmes2004-04-17 12:27:37 +0000
commit8b312363990e2df76a1085fa9120ea6467a88c1b (patch)
treed0ffb9d9a2328b4235c6474aaefcfed4fa03e3ed /2004/n
parent8b3bc0049450eb44b2c2c461bec3c3f3801742f8 (diff)
pwm : suppression de plein de fichiers !
Diffstat (limited to '2004/n')
-rw-r--r--2004/n/fpga/src/pwm/affichepwm3.vhd57
-rw-r--r--2004/n/fpga/src/pwm/comptvalue3.vhd85
-rw-r--r--2004/n/fpga/src/pwm/fsmpwm3.vhd78
-rw-r--r--2004/n/fpga/src/pwm/regdata3.vhd47
4 files changed, 0 insertions, 267 deletions
diff --git a/2004/n/fpga/src/pwm/affichepwm3.vhd b/2004/n/fpga/src/pwm/affichepwm3.vhd
deleted file mode 100644
index 1462a61..0000000
--- a/2004/n/fpga/src/pwm/affichepwm3.vhd
+++ /dev/null
@@ -1,57 +0,0 @@
--------------------------------------------------------------------------------
---affichepwm3.vhd
---Eurobot 2004 : APB Team
---Auteur : Fidèle GAFAN
---Registre à décalage affichantles signaux PWM
---
---REMARQUE(S):changer tccompt,q et valuecompt
--- si CLK#32MHz et/ou qu'on modifie les valeurs de référence de T1
--- et T2
--- Tcmax=20ms/1us=20161cycles.
---*Si DATACOMPT=0,on veut que T2 vale 0,5ms donc on initialise Q à la valeur
---Q=0,5ms/1us=505.
---*Si DATACOMPT=255,on veut que T2 vale 1,5ms donc on initialise Q à la valeur
---Q=1,5ms/1us=1515.
---*Pour toute autre valeur de DATACOMPT comprise entre les deux précédentes et
---différentes de ces dernières,on initialise Q avec
---Q=(0,5ms/1us)+(DATACOMPT*min[((1,5ms-0,5ms)/1us)/(255-1)]
----------------------------------------------------------------------------------rtl de la sortie pwm en fonction de tc
-
-library ieee;
-use ieee.std_logic_1164.all;
-use ieee.std_logic_unsigned.all;
-use ieee.std_logic_arith.all;
---ENTITE
-entity affichepwm3 is
- port ( RST : in std_logic;
- CLK : in std_logic;
- CLK1USAFF : in std_logic;
- valueaff : in integer range 0 to 1000000;
- outpwm : out std_logic
- );
-end entity;
---ARCHITECTURE
-architecture affichepwm3behav of affichepwm3 is
-
-begin
- process(RST,CLK)
- begin
-
- if RST ='1' then
- if (valueaff = 0)then
- outpwm<='0';
- elsif (valueaff /= 0) then
- outpwm<='1';
- end if;
- elsif (clk'event and clk='1') then
- if (CLK1USAFF='1') then
- if (valueaff = 0)then
- outpwm<='0';
- elsif (valueaff /= 0) then
- outpwm<='1';
- end if;
- end if;
- end if;
-end process;
-end affichepwm3behav;
-
diff --git a/2004/n/fpga/src/pwm/comptvalue3.vhd b/2004/n/fpga/src/pwm/comptvalue3.vhd
deleted file mode 100644
index 0e32003..0000000
--- a/2004/n/fpga/src/pwm/comptvalue3.vhd
+++ /dev/null
@@ -1,85 +0,0 @@
--------------------------------------------------------------------------------
---comptvalue3.vhd
---Eurobot 2004 : APB Team
---Auteur : Fidèle GAFAN
---Module générateur des PWM
---
---REMARQUE(S):changer tccompt,q et valuecompt
--- si CLK#32MHz et/ou qu'on modifie les valeurs de référence de T1
--- et T2
--- Tcmax=20ms/1us=20161cycles.
---*Si DATACOMPT=0,on veut que T2 vale 0,5ms donc on initialise Q à la valeur
---Q=0,5ms/1us=505.
---*Si DATACOMPT=255,on veut que T2 vale 1,5ms donc on initialise Q à la valeur
---Q=1,5ms/1us=1515.
---*Pour toute autre valeur de DATACOMPT comprise entre les deux précédentes et
---différentes de ces dernières,on initialise Q avec
---Q=(0,5ms/1us)+(DATACOMPT*min[((1,5ms-0,5ms)/1us)/(255-1)]
--------------------------------------------------------------------------------
---LIBRARY
-library ieee;
-use ieee.std_logic_1164.all;
-use ieee.std_logic_unsigned.all;
-use ieee.std_logic_arith.all;
---ENTITY
-entity comptvalue3 is
- port (
- RST : in std_logic;
- CLK : in std_logic;
- CLK1USCOMPT : in std_logic;
- loadcompt : in std_logic;
- datacompt : in integer range 0 to 255;
- tccompt : buffer integer range 0 to 20161; --nb de cycles de clk1us
- --pour avoir 19,999712ms
- valuecompt : out integer range 0 to 1000000 --duree pdt laql la sortie
- --reste haute. Decrementee
- );
-end entity;
-
-architecture comptvalue3behav of comptvalue3 is
-
- signal q : integer range 0 to 1000000; --recevra duree courante de valuecompt pdt laql la sortie
- --reste haute. Decrementee
-
-begin
- process(RST,CLK)
-constant tcmax :integer range 0 to 20161:=20161;
- begin
- if (RST = '1') then --initialisation horloge 19,999712ms et
- --premier chargement sans load;role du
- --state1.Prochain etat : calcul ie state3
- tccompt<=tcmax;
- if (datacompt=0) then
- q<=505; --pour data=0 la periode doit durer 0,5ms
- elsif (datacompt=255) then
- q<=1515;--pour data=255 la periode doit durer 1,5ms
- elsif((datacompt/=0)and (datacompt/=255)) then
- q<=(505+(datacompt*3));
- end if;
- elsif (CLK'event and CLK = '1') then
- if (CLK1USCOMPT='1') then
- if (loadcompt = '1') then --state2 chargement pendant 1 clk1us
- tccompt<=tcmax; --pdt 1 clk1us, tccompt reste max
- if (datacompt=0) then
- q<=505;--pour data=0 la periode doit durer 0,5ms
- elsif (datacompt=255) then
- q<=1515;--pour data=255 la periode doit durer 1,5ms
- elsif ((datacompt/=0)and (datacompt/=255)) then
- q<=(505+(datacompt*3));
- end if;
- elsif (loadcompt='0') then --state3 calculs a chaque front de clk1us
- if (q/=0) then
- q<=(q-1);
- tccompt<=((tccompt)-1);
- elsif (q=0) then
- q<=0;
- tccompt<=((tccompt)-1);
- end if;
- end if;--if du loadcompt
- end if;--if du clk1us
- end if;--elsif du clk et rst
- end process;
- valuecompt <= q;
-end comptvalue3behav;
-
-
diff --git a/2004/n/fpga/src/pwm/fsmpwm3.vhd b/2004/n/fpga/src/pwm/fsmpwm3.vhd
deleted file mode 100644
index 4776b30..0000000
--- a/2004/n/fpga/src/pwm/fsmpwm3.vhd
+++ /dev/null
@@ -1,78 +0,0 @@
--------------------------------------------------------------------------------
---fsmpwm3.vhd
---Eurobot 2004 : APB Team
---Auteur : Fidèle GAFAN
---Séquenceur du module générateur des signaux de commande du servo-moteur
---
---REMARQUE(S):NADA
--------------------------------------------------------------------------------
-library IEEE;
-use IEEE.std_logic_1164.all;
-use IEEE.std_logic_arith.all;
-use IEEE.std_logic_unsigned.all;
-library work;
-library synopsys;
-use synopsys.bv_arithmetic.all;
---ENTITY
-
-entity fsmpwm3 is
-port( RST :in std_logic;
- CLK :in std_logic;
- CLK1USFSM :in std_logic;
- tcfsm :in integer range 0 to 20161;--synch des 20 ms
- enloadfsm :out std_logic
- );
-end fsmpwm3;
-
-
---ARCHITECTURE
-architecture BEHAV of fsmpwm3 is
-
-type machine is (STATE1,STATE2, STATE3);
- signal state_c,state_f : machine;
-begin
-
- -- PROCESS COMBI
- process(CLK1USFSM,tcfsm,state_c)
-constant tcmax :integer range 0 to 20161:= 20161;
- begin
- enloadfsm <='0';
- state_f <= state_c;
- case state_c is
- when STATE1 => enloadfsm<='0'; --demarrage avec prem valeur de data
- --sans necessite de load a 1:regdata
- --sort 0
- state_f<=STATE3; --passe a st3 dès front de clk1us
- --pour calculs
-
- when STATE2 => enloadfsm<='1'; --chargement pendant 1 cycle de
- --clk1us et tc est max
- state_f<=STATE3;
- when STATE3 => enloadfsm<='0'; --calculs
-
- if (tcfsm=0) then --test de fin de comptage des 20ms
- state_f<=STATE2;
- elsif ((tcfsm<=tcmax) and (tcfsm/=0)) then --continuer à compter jusqu'à 20ms
- state_f<=STATE3;
- elsif ((tcfsm>tcmax)) then
- state_f<=STATE2;
- end if;
- when others => null;
-
- end case;
- end process;
-
- -- PROCESS SEQ
- process (RST,CLK)
- begin
- if (RST='1') then
- state_c<=STATE1;
- --enloadfsm<='0';--si mis, indéterminée !!!
- elsif (CLK'event and CLK='1') then
- if (CLK1USFSM='1') then
- state_c <= state_f;
- end if;end if;
- end process;
-
- end BEHAV;
-
diff --git a/2004/n/fpga/src/pwm/regdata3.vhd b/2004/n/fpga/src/pwm/regdata3.vhd
deleted file mode 100644
index d3ccc1e..0000000
--- a/2004/n/fpga/src/pwm/regdata3.vhd
+++ /dev/null
@@ -1,47 +0,0 @@
---*************************************************************
---*regdata3.vhd *
---*Eurobot 2004 : APB Team *
---*Auteur : Fidèle GAFAN *
---*Registre de *
---* sauvegarde des donnees entrant *
---* conversion des vecteurs en entiers *
---* mise à disposition de cette donnée pour les autres modules*
---*REMARQUE(S) *
---*pour reset=1:le premier PWM fait 0,5ms *
---*************************************************************
---LIBRARIES
-library IEEE;
-use IEEE.std_logic_1164.all;
-use IEEE.std_logic_arith.all;
-use IEEE.std_logic_unsigned.all;
-library work;
-library synopsys;
-use synopsys.bv_arithmetic.all;
---ENTITY
-entity regdata3 is
-port( RST : in std_logic;
- CLK : in std_logic;
- CLK1USREG : in std_logic;--horloge se déclenchant toutes les 1us
- enloadreg: in std_logic; --autorisation de chargement provenant de fsm
- datain: in std_logic_vector (7 downto 0);
- datareg: out integer range 0 to 255
- );
-end regdata3;
---ARCHITECTURE
-architecture BEHAV of regdata3 is
-begin
-process (RST,clk)
-begin
-if (RST='1') then
- datareg<=0; --valeur par défaut de la sortie=0,5ms
- --datareg<=conv_integer(std_logic_vector(datain (7 downto 0))); --à
- --activer si on veut un démarrage immédiat
-elsif (CLK'event and CLK = '1') then
- if (CLK1USREG='1') then --chargement toutes les 1us si load=1
- if (enloadreg='1') then
- datareg<=conv_integer(std_logic_vector(datain (7 downto 0)));
- end if;
- end if;
-end if;
-end process;
-end BEHAV;