Hi Marty, Well, I'm currently working on a project involving the 16F877 and the Timers, so maybe I'll be able to help you out. As you discovered, there are no built-in commands for using the timer - however most of the work that needs to be done can be completed by writing to registers. Just like you might say 'TRISB = %00001111' or 'TRISB= 0Fh' in PICBasic to set the port output register, you can just as easily say 'T1CON = %00000001'. PICBasic automatically recognizes these names and associates them with the appropriate registers in the PIC itself. Kind of like when you include the header file in your assembly code. In this first example, T1CON is the Timer1 control register and setting bit0 turns on the timer. Then if you wanted to enable the CCP function, just look up the necessary register in the PIC's data sheet and set it's bits accordingly (something like 'CCP1CON = %00001001'). I like to use the percent symbol and binary to set the bits, as I find it's easier for me to read. All of these registers and their functions are outlined in the PIC datasheet. One other thing to note is that most of the Timer1 functions are 16-bit and are therefore made up 2 different 8-bit registers. To more easily work with this, declare the relevant PICBasic Variables like: Ton var word Ton_h var ton.byte1 'Set Ton_h to be the high-byte of Ton Ton_l var ton.byte0 'Set Ton_l to be the low-byte of Ton Then you can do stuff like: CCP1CON = %00001001 'Timer1 Compare, clear output on match CCPR1H = Ton_h 'Set the high-byte of the compare value CCPR1L = Ton_l 'Set the low-byte of the compare value After setting up the Capture/Compare (CCP) module of your PIC. Timers are pretty confusing, so if you havn't used them before I'd recommend doing a few small "test" programs to get used to it. Anyhow, I hope this helps! If you need any more assistance feel free to ask - It doesn't seem as though too many people around here use the PICBasic Pro compiler. As it is, I only have about 1 year of experience with it, so I'm also relatively new. Anyhow I should probably end this now before I take up any more bandwidth. Good luck! -Andy C. -----Original Message----- From: Marty [mailto:mmmagic@OPTUSNET.COM.AU] Sent: Saturday, July 26, 2003 11:21 PM To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]; Using TIMERS withi PICbasic Pro. Hi all, Just a quick question... How can i use/access the Timers/prescalers etc by using " PIC Basic Pro " there doesnt seem to be any timer related commands. I remember reading a similar question, and something to do with using peek/poke, although the picbasic manual says "do NOT use peek/poke"....why is that anyway? Otherwsie i think the other answer was something about assigning the address of the timer/prescaler/settings as variables and use them that way? How exactly would i go about this? Here's my setup .... PICs used : 16F84 & 16F877 Compiler : " PICbasic Pro v2.33 " (upgrading to v2.40 asap) Developer IDE : " CDlite " Programmer : " PICall " Burner : " PIC16Pro " Thanx in advance everyone :-) Marty Winch --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.504 / Virus Database: 302 - Release Date: 7/24/03 -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu