Tak zastanawialem sie nad epromem jednak troche inaczej to rozwiazane - taki backup wrazie wysypania sie pamieci. Niestety sama zmiana map nie wystarczy kiedys cos takiego wlasnie mialo byc, jednak na chwile obecna potrzebuje mozliwosci zmiany calego frmware dla oryginalnego ECU. Poprostu w przypadku jakis zmian musial bym za kazdym razem przeprogramowywac osobno EPROM. W takim rozwiazaniu cale UPDATE mozna robic po kabelku...
Kod: Zaznacz cały
--------------------------------------------------------------------------------
-- SubModule DataDetector
-- Created 2006-05-14 23:21:10
--------------------------------------------------------------------------------
library IEEE;
use IEEE.Std_Logic_1164.all;
Use ieee.std_logic_unsigned.all;
entity DataDetector is port
(
Ain : in std_logic_vector(14 downto 0);
Aout : out std_logic_vector(14 downto 0);
Mapa : in std_logic_vector(2 downto 0);
Ena : in std_logic
);
end DataDetector;
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
architecture RTL of DataDetector is
-- Component Declarations
Signal Offset1 : Std_Logic_Vector (14 downto 0);
-- Signal Declarations
-- Offset:
-- 0000-00ff REG_FUEL,&H3700,16,16,256,1,Low octane Fuel map
-- 0100-01ff REG_FIRE,&H3A00,16,16,256,1,Low octane Ignition time
-- 0200-02ff HIGH_FUEL,&H3D00,16,16,256,1,High octane Fuel map
-- 0300-03ff HIGH_FIRE,&H3C00,16,16,256,1,High octane Ignition time
-- 0400-040f TP_SCALE_FUEL,&H3BC0,16,1,16,1,TP scale (Fuel)
-- 0410-041f RPM_SCALE_FUEL,&H3BD0,16,1,16,50,RPM scale (Fuel)
-- 0420-042f TP_SCALE_FIRE,&H3BE0,16,1,16,1,TP scale (Ignition time)
-- 0430-043f RPM_SCALE_FIRE,&H3BF0,16,1,16,50,RPM scale (Ignition time)
-- 0440-044f AF_LIMIT,&H3690,16,1,16,1,TP Limit
-- 0450-045f ADD_MAP3,&H3890,32,1,16,1,Dwell Duty
-- 0460-046f ADD_MAP1,&H3990,16,1,16,1,Variable air close
-- 0470-047f ADD_MAP2,&H39A0,16,1,16,1,Variable air open
-- 0480-048f ADD_MAP5,&H3EB0,16,1,16,1,AFR enrich vs Water Temp
-- 0490-049f TTP_MAX,&H3F40,16,1,16,1,TTP MAX
-- 04a0-051f VQ_MAP,&H3E00,16,1,128,1,VQ map
-- 0520-053f ADD_MAP4,&H39E0,32,1,32,1,voltage (0.16v step) vs water temp (value - 50ş)
-- 0540-0547 ADD_FUEL,&H3970,8,1,8,1,Acceleration increase volume
-- 0548-0549 K_DATA,&H3F80,2,1,2,1,K required number
-- 054a SPEED1_LIMIT,&H392C,2,1,1,2,Speed Limit 1
-- 054b REV1_LIMIT,&H3980,1,1,1,50,Rev. Limit 1
-- 054c REV2_LIMIT,&H3981,1,1,1,50,Rev. Limit 2
-- 054d REV3_LIMIT,&H3982,1,1,1,50,Rev. Limit 3
-- 054e REV4_LIMIT,&H3983,1,1,1,50,Rev. Limit 4
-- 054f IGN_TIME,&H3F8F,1,1,1,1,Void blast-off time
begin
Process (Mapa)
begin
if (Mapa = "00") then Offset1 <= "100000000000000";
elsif (Mapa = "01") then Offset1 <= "100011000000000";
elsif (Mapa = "10") then Offset1 <= "100110000000000";
elsif (Mapa = "11") then Offset1 <= "101001000000000";
end if;
end Process;
Process (Ain)
begin
if (Ain >= X"3690") and (Ain <= X"369F") and (Ena = '1') then
Aout <= Ain - "11011010010000" + "10001000000" + Offset1; -- AF_LIMIT,&H3690,16,1,16,1,TP Limit
elsif (Ain >= X"3700") and (Ain <= X"37FF") and (Ena = '1') then
Aout <= Ain - "11011100000000" + Offset1; -- REG_FUEL,&H3700,16,16,256,1,Low octane Fuel map
elsif (Ain >= X"3890") and (Ain <= X"389F") and (Ena = '1') then
Aout <= Ain - "11100010010000" + "10001010000" + Offset1; -- ADD_MAP3,&H3890,32,1,16,1,Dwell Duty
elsif (Ain = X"392C") and (Ena = '1') then
Aout <= Offset1 + "10101001010"; -- SPEED1_LIMIT,&H392C,2,1,1,2,Speed Limit 1
elsif (Ain >= X"3970") and (Ain <= X"3977") and (Ena = '1') then
Aout <= Ain - "11100101110000" + "10101000000" + Offset1; -- ADD_FUEL,&H3970,8,1,8,1,Acceleration increase volume
elsif (Ain = X"3980") and (Ena = '1') then
Aout <= Offset1 + "10101001011"; -- REV1_LIMIT,&H3980,1,1,1,50,Rev. Limit 1
elsif (Ain = X"3981") and (Ena = '1') then
Aout <= Offset1 + "10101001100"; -- REV2_LIMIT,&H3981,1,1,1,50,Rev. Limit 2
elsif (Ain = X"3982") and (Ena = '1') then
Aout <= Offset1 + "10101001101"; -- REV3_LIMIT,&H3982,1,1,1,50,Rev. Limit 3
elsif (Ain = X"3983") and (Ena = '1') then
Aout <= Offset1 + "10101001110"; -- REV4_LIMIT,&H3983,1,1,1,50,Rev. Limit 4
elsif (Ain >= X"3990") and (Ain <= X"399F") and (Ena = '1') then
Aout <= Ain - "11100110010000" + "10001100000" + Offset1; -- ADD_MAP1,&H3990,16,1,16,1,Variable air close
elsif (Ain >= X"39A0") and (Ain <= X"39AF") and (Ena = '1') then
Aout <= Ain - "11100110100000" + "10001110000" + Offset1; -- ADD_MAP2,&H39A0,16,1,16,1,Variable air open
elsif (Ain >= X"39E0") and (Ain <= X"39FF") and (Ena = '1') then
Aout <= Ain - "11100111100000" + "10100100000" + Offset1; -- ADD_MAP4,&H39E0,32,1,32,1,voltage (0.16v step) vs water temp (value - 50ş)
elsif (Ain >= X"3A00") and (Ain <= X"3AFF") and (Ena = '1') then
Aout <= Ain - "11101000000000" + "100000000" + Offset1; -- REG_FIRE,&H3A00,16,16,256,1,Low octane Ignition time
elsif (Ain >= X"3BC0") and (Ain <= X"3BCF") and (Ena = '1') then
Aout <= Ain - "11101111000000" + "10000000000" + Offset1; -- TP_SCALE_FUEL,&H3BC0,16,1,16,1,TP scale (Fuel)
elsif (Ain >= X"3BD0") and (Ain <= X"3BDF") and (Ena = '1') then
Aout <= Ain - "11101111010000" + "10000010000" + Offset1; -- RPM_SCALE_FUEL,&H3BD0,16,1,16,50,RPM scale (Fuel)
elsif (Ain >= X"3BE0") and (Ain <= X"3BEF") and (Ena = '1') then
Aout <= Ain - "11101111100000" + "10000100000" + Offset1; -- TP_SCALE_FIRE,&H3BE0,16,1,16,1,TP scale (Ignition time)
elsif (Ain >= X"3BF0") and (Ain <= X"3BFF") and (Ena = '1') then
Aout <= Ain - "11101111110000" + "10000110000" + Offset1; -- RPM_SCALE_FIRE,&H3BF0,16,1,16,50,RPM scale (Ignition time)
elsif (Ain >= X"3C00") and (Ain <= X"3CFF") and (Ena = '1') then
Aout <= Ain - "11110000000000" + "1100000000" + Offset1; -- HIGH_FIRE,&H3C00,16,16,256,1,High octane Ignition time
elsif (Ain >= X"3D00") and (Ain <= X"3DFF") and (Ena = '1') then
Aout <= Ain - "11110100000000" + "1000000000" + Offset1; -- HIGH_FUEL,&H3D00,16,16,256,1,High octane Fuel map
elsif (Ain >= X"3E00") and (Ain <= X"3E7F") and (Ena = '1') then
Aout <= Ain - "11111000000000" + "10010100000" + Offset1; -- VQ_MAP,&H3E00,16,1,128,1,VQ map
elsif (Ain >= X"3EB0") and (Ain <= X"3EBF") and (Ena = '1') then
Aout <= Ain - "11111010110000" + "10010000000" + Offset1; -- ADD_MAP5,&H3EB0,16,1,16,1,AFR enrich vs Water Temp
elsif (Ain >= X"3F40") and (Ain <= X"3F4F") and (Ena = '1') then
Aout <= Ain - "11111101000000" + "10010010000" + Offset1; -- TTP_MAX,&H3F40,16,1,16,1,TTP MAX
elsif (Ain >= X"3F80") and (Ain <= X"3F81") and (Ena = '1') then
Aout <= Ain - "11111110000000" + "10101001000" + Offset1; -- K_DATA,&H3F80,2,1,2,1,K required number
elsif (Ain = X"3F8F") and (Ena = '1') then
Aout <= Offset1 + "10101001111"; -- IGN_TIME,&H3F8F,1,1,1,1,Void blast-off time
else Aout <= Ain;
end if;
end Process;
end RTL;
--------------------------------------------------------------------------------
Jednak mysle ze FRAM powinien byc w tym wypadku stabilny jesli chodzi o zapis i odczyt.
W przypadku zastosowania FLASH-a musial bym jeszcze dolozyc SRAM gdyz same RAMBLOCK-i z FPGA nie wystarcza pozatym potrzebuje czesc z nich uzyc jako szybkie pamiecy dwuportowe. Kolejna sprawa do dozucenie epromu to kolejna elektronika i mniejsce na plytce...
No i FLSH to kolejny problem podzial na bloki czyli zmiana = kasowanie calego sektora i zapis go na nowo wiec w SRAM trzeba przechowac caly sektor. W przypadku zaniku napiecia po wykonaniu komendy kasowania sektora wszystko co bylo zpamietane w SRAM leci w kosmos...
Odnosnie Atmela na 3.3V to nie ma problemu z zasilaniem bo FPGA i wiekszosc ukladow ma takie zasilanie. W sumie FPGA potrzebuje napiec 1.2V 2.5V i 3.3V - wszystko to jest zrealizowane.