Sunday, March 1, 2009

Putting it together...

It is time to put the pieces together.... even if all is not ready. The "XE164 to Display connections" post explayin how the XE164 is driving the Display module, now remains only to solder the connectors: I decided to solder connectors to the XE164 KeyChain board so to be flexible to replace it (you never know... and since I have not done any dedicated PCB, I'm afraid that I will need maintenance!). For the insystem flash programming and for the debug the XE164 KeyChain makes available the JTAG interface, I solder then a dedicated conector on the top side, all is visible in the picture:
The little adaptor board is intended to:
- supply the the XE164 KeyChain providing 5V (I just use an old fashion 7805 linear voltage regulator)
- be the interface board connecting the display to the XE164
- be the interface board for speed sensors (electronics not yet soldered)
- be the interface board for Oil Temperature sensor (I use the one already available on the YAMAHA R6, so I just need to protect the XE164 and convert the signal with the ADC) - be the interface board for fuel level signal
- be the interface board for any forther expansion (feel free to post ideas...).

At the end, this is the video of the first power-on:

where I have created a demo project where the weels and engine speed are generated by the SW itself, this permit to observe all the Display Messages (real debug will come once the weeling speed sensors will be connected). Anyhow, the first bug has been discovered: the Display refresh speed is too slow !!!
To fix it I had to reload Timer_4 counter to the 480Hz value after each Interrupt Service occours:
//****************************************************************************
// @Function void GPT1_viTmr4(void)
//
//----------------------------------------------------------------------------
// @Description This is the interrupt service routine for the GPT1 timer 4.
// It is called up in the case of over or underflow of the
// timer 4 register.
// If the incremental interface mode is selected and the
// interrupt for this mode is not disabled it is called up if
// count edge or count direction was detected.
//
// Please note that you have to add application specific code
// to this function.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Date 3/1/2009
//
//****************************************************************************

void GPT1_viTmr4(void) interrupt T4INT
{
// Stop Timer first !
GPT1_vStopTmr(GPT1_TIMER_4);


if ( ucDisplayDigit[ucIdx] != 0xFF )
{
SelectDigit ( 0 ); // Deselect any DIGIT
Display ( ucDisplayDigit[ucIdx] );
// DOT driver
if ( ucDisplayDigit[ucIdx]>>4 )
IO_vSetPin ( IO_P0_6 );
else
IO_vResetPin ( IO_P0_6 );

SelectDigit ( ucIdx );
}
ucIdx++;
if ( ucIdx > 5 ) ucIdx = 0;

// Start Timer
GPT12E_T4 = TIMER4_480Hz;
GPT1_vStartTmr(GPT1_TIMER_4);

} // End of function GPT1_viTmr4
... now, beliewe me, the refresh speed is as expected and the digits are really bright and stable.

No comments: