Need help for Minimon + C167 + 29F400 (Read Ok/Write impossible)
Hello all!
I try to write in 29F400 but I need help with Minimon. I did a lot of tests for hours and hours. I read lots of informations on the net. Infineon C167CS User Manual is very useful but I need help.
I can read 29F400 with success OK! But impossible to Write or Erase... I had set driver A29F400b.hex
I think the problem come from the registers settings Buscon and Addrsel because maybe I don't understand all very well.
What should be the settings in the [Register] and [Memory] section in file Default.ini ? What should be 29f400 start address with my config?
Here is my config:
C167CS-LM (No internal Rom) 8mhz x 3 = 24mhz Connected in Boot-Mode with asc0 port (Usart, NOT K-line)
4MB Flash (AM29F400BB-55) Word Mode (16 Bit ; Pin "BYTE" to +5V) 16 Bit demultiplexed Bus OE to C167 Pin CS0 (P6.0) WE to C167 Pin CS1 (P6.1) CE to Ground
*Reset: BUSCON0=0680 *Reset: SYSCON=0400 *Reset Configuration: External Bus enabled *Reset Configuration: 16 Bit demultiplexed Bus *Reset Configuration: WR# and BHE# retain their normal function (P0H.0=0) *Reset Configuration: On chip watchdog timer is disabled (RD#=0) *Reset Configuration: Lengthened ALE signal
RP0H=00C7 (5 "chip select" activated) ...But I think only 3 CS signals are used, CS0,CS1, and CS3 connected on 74HCT574D Clock Input (Pin 11)
-------------- Address Pinout 29F400 / C167
A0 / A1 A1 / A2 A2 / A3 A3 / A4 A4 / A5 A5 / A6 A6 / A7 A7 / A8 A8 / A9 A9 / A10 A10 / A11 A11 / A12 A12 / A13 A13 / A14 A14 / A15 A15 / A16 A16 / A17 A17 / A18 --------------
-------------- Data Pinout 29F400 / C167
DQ0 / AD15 DQ1 / AD13 DQ2 / AD11 DQ3 / AD9 DQ4 / AD0 DQ5 / AD2 DQ6 / AD4 DQ7 / AD6 DQ8 / AD14 DQ9 / AD12 DQ10 / AD10 DQ11 / AD8 DQ12 / AD1 DQ13 / AD3 DQ14 / AD5 DQ15 / AD7 --------------
Thank you for your big help!
Chris
You are connecting signals:
OE to C167 Pin CS0 (P6.0) WE to C167 Pin CS1 (P6.1) CE to Ground
Shouldn't CE go to CS(0), OE go to RD, WE go to WR? Find an example schematic from Keil to see what I mean... Keil should have example startup code to go with it, so you can see how the BUSCON and other registers are set up to match the circuit design.
Also, Flash won't erase or write unless you program the Flash Command Register properly. How are you using the Command Register?
It is too bad you are using the C167CS-LM with no internal ROM but you need Flash so you're trying to use external Flash, from what I just read of MiniMon it has support for on-chip Flash programming, but not external Flash. Isn't your application better suited for a 'C166 variant with on-chip Flash? There's better tool support for on-chip Flash in my experience, especially for the newbie.
Hello! It's a Automotive ECU and I can't modify it. For the registers, I have disassembled original file an here is :
008046: MOV CP,#F206h 00804A: NOP 00804C: MOV DPP0,#0024h 008050: MOV DPP1,#0028h 008054: MOV DPP2,#0025h 008058: EXTR #1 00805A: MOV XPERCON,#0C03h 00805E: BFLDH SYSCON,#FFh,#E3h 008062: BFLDL SYSCON,#FFh,#0Eh 008066: MOV ADDRSEL1,#1008h 00806A: MOV ADDRSEL2,#FFF0h 00806E: MOV ADDRSEL3,#00A0h 008072: MOV ADDRSEL4,#FFE0h 008076: BFLDH BUSCON0,#DFh,#45h 00807A: BFLDL BUSCON0,#FFh,#BFh 00807E: BFLDH BUSCON1,#DFh,#85h 008082: BFLDL BUSCON1,#FFh,#8Eh 008086: BFLDH BUSCON2,#DFh,#05h 00808A: BFLDL BUSCON2,#FFh,#2Eh 00808E: BFLDH BUSCON3,#DFh,#85h 008092: BFLDL BUSCON3,#FFh,#AFh 008096: BFLDH BUSCON4,#DFh,#01h 00809A: BFLDL BUSCON4,#FFh,#3Fh 00809E: EXTR #1 0080A0: MOV PICON,#00CFh 0080A4: MOV STKOV,#F228h 0080A8: MOV STKUN,#F2C4h 0080AC: MOV SP,#F2C4h 0080B0: MOV R8,#003Bh 0080B4: MOV DPP3:3D06h,R8 0080B8: EXTP #0002h,#1 0080BC: MOV 2000h,R8 0080C0: EINIT
I have used this but I don't know if DPP0, DPP1, DPP2, DPP3, STKOV, STKUN, CP, SP are necessary :
XPERCON : 0C03 SYSCON : E30E ADDRSEL1 : 1008 (I have tried with 100A for 4Mb) ADDRSEL2 : FFF0 ADDRSEL3 : 00A0 ADDRSEL4 : FFE0 BUSCON0 : 45BF BUSCON1 : 858E BUSCON2 : 052E BUSCON3 : 85AF BUSCON4 : 013F PICON : 00CF
Hello,
I dont know if this thread is closed... but i know well this problem with automotive ECU (may be this is a Siemens unit?)
You have to rewrite (and recompile) the minimon driver in order to correct the memory patterns:
The problem is that the data lines are crossed (for routing simplification): when the C167 "wants" to write the "sequences" (see the amd datasheet)the memory doesen't see the right values.
for example, in some cases you must write "44h" on the proc side if you want the memory to see part of the unlock sequence "A0h".
But you surely already had the answer.
Regards.