I had made several video display using the one-chip microcomputers.
http://picasaweb.google.co.jp/MeowJPN/ELJ09#
It was first to use AVR microcomputer and Arduino.
And this time ,I was troubled by jitter.
Back-to-basics, I considered the cause of the jitter.
http://picasaweb.google.co.jp/MeowJPN/ELJ09#5408385710517206802
http://picasaweb.google.co.jp/MeowJPN/ELJ09#5408385794054034978
http://picasaweb.google.co.jp/MeowJPN/ELJ09#5408385879635953218
Then, the jitter was able to be free by putting in compensation processing of delay.
http://picasaweb.google.co.jp/MeowJPN/ELJ09#5408385972967783890
There is no time not much to "Make Tokyo Meeting", and it was difficult to have mastered Arduino IDE.
And I found this web site.
[Arduino Diecimila - Burning the Bootloader without AVR-Writer]
http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html
[Arduino - FAQ]----------------------------------------------
http://arduino.cc/en/Main/FAQ
Can I use an Arduino board without the Arduino software?
Sure. It's just an AVR development board, you can use straight AVR C or C++ (with avr-gcc and avrdude or AVR Studio) to program it.
So, I decided the work with free development environment,
- AVR Studio,WinAVR and that "by FT232RL BitBang Mode AVR-Writer software".
I am considering library creation, it can be used from sketch.
And I'm going to open the library.
But, I'm busy this month.
Another my hobby is to enjoy Radio Control.
I could get many siemens key switches a short time ago.
So, I promised to make a friend of mine a Tx emulator in the 1960s.
After next month that I will resume programming of Arudino.
----- Point of the program -----
I often use the function pointer. To replace processing wholly.
Read TCNT1 at interrupt top.
UH_TCNT1 = TCNT1;
[font=Courier]
[size=6]
/* ----------------------------------------------------
- function pointer -
----------------------------------------------------- */
void( *const TBL_int_icf1[MODE_CRT_N] )(void) = {
CRT_icf1_DBG, /* mode0 DEBUG MODE_CRT_DBG 0 */
CRT_icf1_GRP160_120, /* mode1 160*120 No.1 MODE_CRT_GRP1 1 */
CRT_icf1_GRP160_120, /* mode2 160*120 No.1 MODE_CRT_GRP2 2 */
CRT_icf1_DBG, /* mode3 Menu MODE_CRT_CSL 3 */
CRT_icf1_TXT, /* mode4 MODE_CRT_TXT 4 */
};
/*----------------------------------------------------------------------------
* Function : interrupt ICF1
*---------------------------------------------------------------------------*/
ISR (TIMER1_CAPT_vect)
{
UH_TCNT1 = TCNT1;
(*TBL_int_icf1[UBmodeCRTtbl])();
}
[/size]
[/font]
call compensation processing of delay routine.
CRT_FitDelay( UB_DLY_icf1 );
[font=Courier]
[size=6]
/*----------------------------------------------------------------------------
* Function :
*---------------------------------------------------------------------------*/
void CRT_icf1_GRP160_120( void )
{
UB_DLY_icf1 = ( UB )( UH_TCNT1 & 0xFF );
CRT_FitDelay( UB_DLY_icf1 );
UB_h_line++;
if( UB_h_line == V_SYNC_START ){
OCR1A = CRT_OCR1A_VS;
TCCR1A = CRT_TCCR1A;
}
else if( UB_h_line == V_SYNC_END ){
OCR1A = CRT_OCR1A_HS;
}
if( (UB_h_line >= V_BLANK) && (UB_h_line <= H_LINE_END_GRP) ){
[/size]
[/font]
Compensation processing of delay routine is this.
"CRT_FitDelay" is this.
[font=Courier]
[size=6]
;------------------------------------------------------------------------------
; CRT_Fitdelay.s Compensation Delay program
; Copyright (C) 2009 Masami Watanabe
;
; This program is free software; you can redistribute it and/or modify it
; under the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3 of the License, or (at your option)
; any later version.
;
; This program is distributed in the hope that it will be useful, but
; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License along
; with this program. If not, see <http://www.gnu.org/licenses/>.
;------------------------------------------------------------------------------
CRT_FitDelay: //[ch38306][ch25968][ch12398][ch38283][ch22987]
; 50 49 48 47
cpi delay,50 ;[1] [1/1] [1/1] [1/1] [1/1]
BREQ 50f ;[1/2] [2/3] [1/2] [1/2] [1/2]
cpi delay,49 ;[1] [1/3] [1/3] [1/3]
BREQ 49f ;[1/2] [2/5] [1/4] [1/4]
cpi delay,48 ; [1/5] [1/5]
BREQ 48f ; [2/7] [1/6]
cpi delay,47 ; [1/7]
BREQ 47f ; [2/9]
cpi delay,46
BREQ 46f
cpi delay,45
BREQ 45f
cpi delay,44
BREQ 44f
cpi delay,43
BREQ 43f
cpi delay,42
BREQ 42f
cpi delay,41
BREQ 41f
cpi delay,40
BREQ 40f
cpi delay,39
BREQ 39f
cpi delay,38
BREQ 38f
cpi delay,37
BREQ 37f
cpi delay,36
BREQ 36f
cpi delay,35
BREQ 35f
cpi delay,34
BREQ 34f
cpi delay,33
BREQ 33f
cpi delay,32
BREQ 32f
cpi delay,31
BREQ 31f
cpi delay,30
BREQ 30f
cpi delay,29
BREQ 29f
cpi delay,28
BREQ 28f
cpi delay,27
BREQ 27f
cpi delay,26
BREQ 26f
cpi delay,25
BREQ 25f
cpi delay,24
BREQ 24f
cpi delay,23
BREQ 23f
cpi delay,22
BREQ 22f
cpi delay,21
BREQ 21f
cpi delay,20
BREQ 20f
50: nop ;+31 3 34 84 *62.5ns =5.25us
49: nop ;+30 5 35 84
48: nop ;+29 7 36 84
47: nop ;+28 9 37 84
46: nop ;
45: nop ;
44: nop ;
43: nop ;
42: nop ;
41: nop ;
40: nop ;
39: nop ;
38: nop ;
37: nop ;
36: nop ;
35: nop ;
34: nop ;
33: nop ;
32: nop ;
31: nop ;
30: nop ;
29: nop ;
28: nop ;
27: nop ;
26: nop ;
25: nop ;
24: nop ;
23: nop ;
22: nop ;
21: nop ;
20: nop ;
ret
[/size]
[/font]
I am considering library creation, it can be used from sketch.
And I'm going to open the library.
That source list in which the present condition is not ordered.
Even so if you need the such code, please mail to me.
Thanks