![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
The Stanford document (the other NTSC thread) uses a 63.5 usec horizontal line with a 4.7 usec 'sync' pulse, a 5.9 usec 'back porch', 51.5 usecs of video data, and a 1.4 usec 'front porch'. That works out to a 15,748 KHz frequency. Those timings also work out perfectly for the 100 nsec Tcy when using a 40 MHz crystal on an 18F' device.
There must be some degree of variation that allows the TV to work with different horizontal frequencies? Mike |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Point is crystals come in many frequencies, why would you use something like 20MHz when you could use something that's a better fit for the job at hand? Try digikey for some common frequencies.
|
|
|
|
|
|
|
(permalink) |
|
I have that same mini TV. It sucks lol.
|
|
|
|
|
|
|
(permalink) |
|
14.31818MHz is exactly 910 times the NTSC horizontal frequency, and exactly 4 times the NTSC color subcarrier frequency. You can generate fully interlaced color NTSC if you start with this frequency. Obviously, if you don't need color, you can start with any frequency that will divide down to 15.734kHz and also will give you enough resolution to get reasonably accurate pulse widths for horizontal sync, vertical sync, and equalizing pulses.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Yes, as long as I'm studying and learning I appreciate the value in conforming to the standards and products normally associated with certain applications, but on the other end of things, I think there's some value to trying to explore what can be done with the tools most readily at the disposal of mcu novices. If that can be an entry point to those novices choosing a direction to their liking that's faster, bigger, etc, so be it. |
||
|
|
|
|
|
(permalink) |
|
Crystal, oscillator, resonator: what's the difference, what's the trade-off?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
I cobbled together an isochronous loop below to work out timings. It seems I should be able to paint 120 lines of 256 dots (200 nsecs per dot at 40 MHz) or, probably better, 240 lines of 128 dots (400 nsecs per dot at 20 MHz). ** this is not working code, just a timing exercise... Mike Code:
;
; assuming RA0 connected to resistor(s) to produce the 0.0/0.3v
; level and RB0 connected to resistor(s) to produce the 1.0v
; level.
;
; the first 2 delays would be used to stuff the 32 byte work
; buffer. The 588 cycles available in each of the 20 vertical
; sync' lines would be used for updating the video buffer.
;
frame
movlw 242 ;
movwf hctr ; set horizontal line counter
hline
bcf LATA,0 ; 00.0 usecs - set 0.0v 'sync' level
DelayCy(47) ; "sync"
bsf LATA,0 ; 04.7 usecs - set 0.3v 'blk' level
DelayCy(57) ; "back porch"
B00 movf POSTINC0,W ;
movwf LATB ; 10.6 usecs
nop ;
rrcf LATB,F ; 10.8 usecs
nop ;
rrcf LATB,F ; 11.0 usecs
nop ;
rrcf LATB,F ; 11.2 usecs
nop ;
rrcf LATB,F ; 11.4 usecs
nop ;
rrcf LATB,F ; 11.6 usecs
nop ;
rrcf LATB,F ; 11.8 usecs
nop ;
rrcf LATB,F ; 12.0 usecs
;~~~~~~~
B01..B30 ; same code for bytes 01..30
;~~~~~~~
B31 movf POSTINC0,W ;
movwf LATB ; 60.2 usecs
nop ;
rrcf LATB,F ; 60.4 usecs
nop ;
rrcf LATB,F ; 60.6 usecs
nop ;
rrcf LATB,F ; 60.8 usecs
nop ;
rrcf LATB,F ; 61.0 usecs
nop ;
rrcf LATB,F ; 61.2 usecs
nop ;
rrcf LATB,F ; 61.4 usecs
nop ;
rrcf LATB,F ; 61.6 usecs
;~~~~~~~
nop ; 61.7 usecs
nop ; 61.8 usecs
movlw 20 ; 61.9 usecs
movwf vctr ; 62.0 usecs
clrf LATB ; 62.1 usecs - set 0.3v 'blk' level
DelayCy(14-3) ; "front porch"
decfsz hctr,F ; 63.2 usecs - 242 lines?
bra hline ; 63.3 usecs
nop ; 63.4 usecs
vsyn1
bsf LATA,0 ; set 0.3v level
DelayCy(47-1) ; inverted "sync"
bcf LATA,0 ; set 0.0v level
DelayCy(588-4) ;
decfsz vctr,F ; all 20 vsync lines?
bra vsyn1 ; no, branch, else
;
; the vsyn1 code needs to be modified to jump to "frame" (a
; new frame) with the correct timing...
;
|
||
|
|
|
|
|
(permalink) |
|
The tradeoff is accuracy. A crystal is more accurate than a simple resonator.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
Last edited by Hank Fletcher; 7th June 2008 at 02:54 PM. |
||
|
|
|
|
|
(permalink) |
|
An advantage of a resonator may be built in caps, cheap, and shockproof (crystals are not happy about shocks)
The 14.31818 will get divided by 4 by the PIC, that will make it less than ideal for a 910 division (TMR2) So the magic crystal frequency will be something that multiplies by 62937.0549Hz the closer to 20MHz the more breathing room you'll have. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Ntsc | TKS | Micro Controllers | 5 | 1st June 2006 08:44 PM |
| Convert an NTSC in-car TV | mcncy | Electronic Projects Design/Ideas/Reviews | 4 | 21st March 2004 09:47 AM |
| NTSC-PAL conversion | apakhira | Electronic Projects Design/Ideas/Reviews | 0 | 25th February 2004 05:04 PM |
| NTSC to PAL CONVERTER | thesim | Electronic Projects Design/Ideas/Reviews | 9 | 13th February 2004 03:32 PM |
| NTSC to PAL convertor circuit (NTSC=>RGB; RGB=>PAL) | apakhira | Electronic Projects Design/Ideas/Reviews | 2 | 30th January 2004 05:05 AM |