The Freescale series of 8-bit microcontrollers do not have a specific control register to implement a software reset. When the code needs to be forced to generate a reset during program execution, it must be implemented by some software skills:
Soft reset, the program runs from the beginning, and the hardware does not reset. Reset pin without reset pulse output
This can be achieved by directly obtaining the reset vector:
Void ForceReset(void)
{
uniON {
Void (*vector)(void);
Byte c[2];
} SOFtReset;
softReset.c[0] = *(byte*)0xFFFE; //get the reset vector
softReset.c[1] = *(byte*)0xFFFF;
softReset.vector(); //re-STart the code flow
}
Hard reset, the program runs from the beginning, all internal hardware modules and registers are reset at the same time, the reset pin has a reset pulse output
This must be achieved in conjunction with the internal architectural features of the FSL 8-bit microcontroller:
1) COP (watchdog) reset
This is the easiest way. The program loops and then waits for the watchdog to generate a reset. You must activate the watchdog function beforehand, and there will be a slight delay in the reset process.
Void ForceReset(void)
{
DISAbleInterrupts; //disable all interrupt
For(;;); //wait for watch-dog reset
}
2) Illegal address reset
The microcontroller generates a hardware reset when the instruction addresses a non-existent memory space.
Void ForceReset(void)
{
Asm JMP 0xD000; //jump to illegal address will result a RESET
}
Note that different chips have different effective memory space configurations. The specific address needs to be adjusted according to the chip data sheet.
3) Illegal instruction reset
The microcontroller generates a hardware reset when executing a non-existing instruction code. Here can be divided into two ways:
a) "Illegality" in a specific configuration mode with "legal" instructions, such as the STOP instruction.
If the STOP instruction is disabled by setting the SSTOP bit to 0 in the chip's configuration register, SOPT, if you execute STOP again, it will be considered an illegal instruction and immediately generate a reset.
Void ForceReset(void)
{
Asm STOP; //illegal STOP will result a RESET, note SOPT_STOPE must be 0
}
If your application does not normally use STOP, you can use this method. If you are going to use the STOP instruction, you cannot use this method to generate a reset because the SOPT register can only be written once after reset.
b) artificially create an illegal order and then force it to run.
This is a more general method, this S08 core series can be applied. Confirm an impossible instruction code in the instruction list of the microcontroller, such as 0x9E10, fill it into RAM and then force it to run, and immediately generate a reset.
Void ForceReset(void)
{
Byte illegalCode[2];
illegalCode[0] = 0x9e;
illegalCode[1] = 0x10; //illegal instrucTIon
((void (*)(void))illegalCode)(); //execute illegal instrucTIon will result a RESET
Small computer system interface (SCSI) is an independent processor standard for system level interfaces between computers and intelligent devices (hard disks, floppy drives, optical drives, printers, scanners, etc.). SCSI is an intelligent universal interface standard.
The last SCSI device in the SCSI chain uses a terminator, and the intermediate device does not need a terminator. Once the terminator is used by the intermediate device, the SCSI card cannot find the future SCSI device. If the last device does not use a terminator, SCSI will not work properly. Terminator is composed of resistors, located at the end of the SCSI bus, to reduce the mutual influence of the signal, maintain the constant voltage on the SCSI chain.
Most of the SCSI devices have built-in terminators and use a jumper to control on / off. The SCSI device is highly intelligent and can automatically control the terminator on / off. For example, if a hard disk is connected to a CD-ROM, the CD-ROM can work normally regardless of whether the terminator of the hard disk is on or off. However, when two hard disks are connected, the situation becomes more complicated. Before two Seagate hard disks are connected, one hard disk terminator must be off. Before a Seagate hard disk is connected to a quantum hard disk, a hard disk terminator can work normally regardless of whether it is on or off.
SCSI-90°DIP Section
ShenZhen Antenk Electronics Co,Ltd , https://www.antenksocket.com