Fixed bug that screwed up reading after doing an electrical test.

This commit is contained in:
Doug Brown 2012-03-04 12:03:02 -08:00
parent 7f69cb476d
commit c681547026
2 changed files with 40 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#Sat Dec 24 19:28:57 PST 2011
#Sat Mar 03 13:46:14 PST 2012
avrtarget/ClockFrequency=16000000
avrtarget/ExtRAMSize=0
avrtarget/ExtendedRAM=false
@ -21,7 +21,7 @@ avrtarget/avrdude/Locks/FileName=
avrtarget/avrdude/Locks/MCUid=at90usb646
avrtarget/avrdude/Locks/UseFile=false
avrtarget/avrdude/Locks/Write=false
avrtarget/avrdude/NoChipErase=true
avrtarget/avrdude/NoChipErase=false
avrtarget/avrdude/NoSigCheck=false
avrtarget/avrdude/NoVerify=false
avrtarget/avrdude/NoWrite=false

View File

@ -334,6 +334,44 @@ int SIMMElectricalTest_Run(void (*errorHandler)(uint8_t, uint8_t))
testPin++;
}
// Restore to a normal state. Disable any pull-ups, return CS/OE/WE to outputs,
// deassert them all, set data as an input, set address as an input,
// assert CS and OE. Should be a pretty normal state.
// To start, make everything an input so we can disable pullups.
Ports_SetCSDDR(false);
Ports_SetOEDDR(false);
Ports_SetWEDDR(false);
Ports_SetAddressDDR(0);
Ports_SetDataDDR(0);
// Disable pullups
Ports_SetCSPullup(false);
Ports_SetOEPullup(false);
Ports_SetWEPullup(false);
Ports_AddressPullups_RMW(0, SIMM_ADDRESS_PINS_MASK);
Ports_DataPullups_RMW(0, SIMM_DATA_PINS_MASK);
// Set control lines to deasserted outputs (remember ON is deasserted)
Ports_SetCSDDR(true);
Ports_SetOEDDR(true);
Ports_SetWEDDR(true);
Ports_SetCSOut(true);
Ports_SetOEOut(true);
Ports_SetWEOut(true);
// Set address lines to outputs and set the outputted address to zero
Ports_SetAddressDDR(SIMM_ADDRESS_PINS_MASK);
Ports_SetAddressOut(0);
// Leave data lines as inputs...(they're already inputs so do nothing...)
// Now assert CS and OE so we're in normal "read" mode
Ports_SetCSOut(false);
Ports_SetOEOut(false);
// Now that the final state is restored, return the number of errors found
return numErrors;
}