- Copy Step2 directory to Step3

************ Dave part **************
- Double click on Hot.dav project file
- Configure CAPCOM6:
	Pin control: use pin CCPOS6x as input with internal simulation
	Multi Channel: enable halls sensor mode, transfer on correct hall event, enable Correct and Wrong hall event interrupts
	Tap/Interrupt Control: Interrupt Configuration: enable node 0
- Save your project
- Generate code

************ Keil part **************
- Double click on Hot.dpt project file
- Modify code in UART.c RI interrupt:
					case 0x00: // set duty cycle
						CC6_vLoadChannelShadowRegister(CC6_CHANNEL_3,(unsigned short)value<<8);
						CC6_vEnableShadowTransfer(CC6_TIMER_13);
						break;	
					case 0x01: // set P1: CCPOS...
						P1 = value;
- Add PWM and Hall pattern tables in CC6.c in the CCU6_General User code part:
unsigned char code HallPatterns[6]=
	{
		0x25,		//  Current=100 Expected=101
		0x29,		//  Current=101 Expected=001
		0x0b,		//  Current=001 Expected=011
		0x1a,		//  Current=011 Expected=010
		0x16,		//  Current=010 Expected=110
		0x34		//  Current=110 Expected=100
  };

unsigned char code PWMPatterns[6]=
	{
		0x24,		//	U=0 V=- W=+ COUT62/CC62=10 COUT61/CC61=01 COUT60/CC60=00 
		0x06,		//	U=+ V=- W=0 COUT62/CC62=00 COUT61/CC61=01 COUT60/CC60=10 
		0x12,		//	U=+ V=0 W=- COUT62/CC62=01 COUT61/CC61=00 COUT60/CC60=10 
		0x18,		//	U=0 V=+ W=- COUT62/CC62=01 COUT61/CC61=10 COUT60/CC60=00 
		0x09,		//	U=- V=+ W=0 COUT62/CC62=00 COUT61/CC61=10 COUT60/CC60=01 
		0x21		//	U=- V=0 W=+ COUT62/CC62=10 COUT61/CC61=00 COUT60/CC60=01
	};

unsigned char CurrentState;
- Add code for initialization in CC6.c user code part of CC6_vInit:
	CurrentState = 0;
	MCMOUTSL = PWMPatterns[5];		// load the shadow registers with according patterns
	MCMOUTSH = HallPatterns[5];
	MCMOUTSL |= 0x80;			// Shadow transfer request to initiate things
	MCMOUTSH |= 0x80;
	MCMOUTSL = PWMPatterns[0];		// load the shadow registers with according patterns
	MCMOUTSH = HallPatterns[0];
- Add code for Wrong Hall Event interrupt:
		SBUF = 0xff; // send an error
- Add code for Correct Hall Event interrupt:
		CurrentState ++;
		if (CurrentState>=6)
			CurrentState = 0;
		MCMOUTSL = PWMPatterns[CurrentState];		// load the shadow registers with according patterns
		MCMOUTSH = HallPatterns[CurrentState];

		SBUF = CurrentState; // send an acknowledge
- Compile and download to the C868 Mini Board (take care of any other programs using serial link)

************ Docklight part **************
- Launch DockLight
- Start with a blank project
- Configure for COM1 (or any other on which the board is connected),  9600 bauds
- Add Sequence : 
	Name: Set Duty Cycle
	Sequence: 0x00, 0x40
- Add Sequence : 
	Name: Set Hall Sensors
	Sequence: 0x01, 0x??
- (Save your project into the Step3 directory) this is not possible with the evaluation version !
- Try different hall patterns and different duty cycles...
