![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| PIC Programing / Design Discuss programing of PIC chips here and design of electronics using PIC chips. |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
Anyone have problems of getting a Tim1 32khz Ext. Osc working? I am having a frustrating time with getting the oscillator to run, on both a 62F628 and a 16F870. I am using a popular Epson 32.768khz xtal. I have gone from 12pf to 25pf for the caps, before I look for another Xtal, is there anything in particular I may have overlooked? Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
|
#2
| |||
| |||
| Config settings? ![]() Pop in a garden variety 4MHz xtal and see if it runs. That at least will confim config and T1CON settings. Some of those 32kHz xtals are a little fussy as they are meant for micropower use, especially the tiny cylindrical type (watch xtals). I have had some results using a series resistor with the xtal I think about 1k but this is some years ago now. |
|
#3
| ||||
| ||||
I have ordered a different xtal and a range of caps, so hopefully I will have more luck. I am using a pre-tested code from a tutorial as a test. The only common thing so far is the xtal?? If all else fails I will try the 1k. Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
|
#4
| |||
| |||
| Al, I don't have datasheets handy for the PICs you tried, but there are probably two different config bits that need to be set for the xtal to work properly. In other PIC chips, the T1CON (timer 1 control register) has to have the T1OSCEN bit set (to enable the external oscillator) and the TMR1CS bit set ( to select the external clock).
__________________ Diplomacy is the art of saying "Nice doggie" until you can find a rock. - Will Rogers |
|
#5
| ||||
| ||||
| I have set the T1CON register in the program, it is the config or configuration word that I was questioning, in the 16F628 it is register 14-1 or the __config instruction set at programming time. Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
| Sponsored Links |
|
#6
| ||||
| ||||
Al, the PIC16F870 can be operated in 4 different oscillator modes. Please see the data sheet here; http://melabs.picbasic.com/devicedata/30569a.pdf For the 32Khz xtal, you need 33pf caps. Please see pages 91 and 92. Also make sure that you have the proper mode set; • LP Low Power Crystal • XT Crystal/Resonator • HS High Speed Crystal/Resonator • RC Resistor/Capacitor Hope this helps, Iron-Man |
|
#7
| ||||
| ||||
This is running OK as the program runs, it is the TI0SO/TIOSI, TIM1 clock, which appears to be LP type by default. I get no 'scope signal at the 32khz xtal pins, I am testing with the x10 scope lead as is recommended. As far as I have been able to tell in the documentation, the 16 bit configuration register does not apply to the TIM1 oscillator? I will try more tests today, including the 33pf. Thanks. Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
|
#9
| |||
| |||
| You didn't try the resistor like I suggested? Re the configs, some of the later PICs have config bits that affect pin operation for the external TMR1 osc. I didn't check the 16F870 datasheet but since it's an earlier PIC there's probably no config needed. |
|
#10
| ||||
| ||||
|
I am going to see if I can get back to it tonight or tomorrow. I even have a 7404 external xtal clock to mock up if all else fails. The F628 is practically the same set up for the 32.768khz clock xtal. From what I have read so far, these watch xtal's are finicky to get started. Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
| Sponsored Links |
|
#11
| ||||
| ||||
| Al_The_Man, Could you clarify exactly what you're trying to do? I need clarification on something. Also, I haven't used the 16 series in years, but am very familiar with the 18 series. Just took a look at the 16F628 data sheet though.
T1CON.0 -> 1 Timer1 enabled T1CON.1 -> 1 external clock from in RB6/T1OSO T1CON.2 -> 1 Do not synch external clock input. (if you are using this for sleep then you need to make sure that this is not synchronized) T1CON.3-> 1 Oscillator enabled T1CON.4-5 -> configure prescale value (1:1 -> 1:8) T1CON.6,7 -> unimplemented- doesnt' matter. Note that the datasheet suggests 15pF, but acknowledge that these values may need to be changed. I may be (VERY possibly) remembering this incorrectly, but on some of the older chips (16F877?) I think putting a scope probe, even on 10X directly on the oscillator (this was the main external highest speed crystal oscillator, 20MHZ) caused it to not oscillate. Don't know what the inputs/outputs are like on the 628 when it's set up for T1osc mode. It may be worth the 15 minutes to hook up an HC04 or equivalent as a buffer so you can see it on the scope, or at least confirm that you can't see it on the scope... Hope this helps. -Matt |
|
#12
| ||||
| ||||
| I need the precise 1 second clock, basically, to measure a low freq pulse. System clock and Tim1 clk, the only difference is I am using the internal system clock to run the main code, the article uses an external xtal system clock also. http://electronicdesign.com/article/...ncies8513.aspx I have the code which is no longer available since E.D. moved their site. Al.
__________________ CNC, Mechatronics Integration and Machine Design. “Logic will get you from A to B. Imagination will take you everywhere.” Albert E. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help!- Optical Crystal | adrianhdezch | Laser Engraving & Cutting Machines | 5 | 09-02-2010 01:26 AM |
| Surface finish problem - Could you please help me overcome this problem? | DMBGO | EMCO Lathe | 5 | 08-04-2010 05:33 PM |
| Supply mini 2D/3D crystal laser subsurface engraving machine | 3dlasermachine | Product Announcements & Manufacturer News | 1 | 09-07-2009 10:15 PM |
| Build Thread- laser cutting crystal | Jiepu-Crystal | Laser Engraving & Cutting Machines | 0 | 08-07-2009 12:35 AM |
| Build Thread- laser crystal | Jiepu-Crystal | Laser Engraving & Cutting Machines | 0 | 08-06-2009 09:50 PM |