>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? > I'm just now learning PICBasic, and what I've figured out is this: You have to set the registers in Basic, the same as you would in assembly. For example: TMR1CON = %00001110 would initialize the Timer1 to prescaler of 1, not sync'ed, ext osc on, timer not incrementing (IIRC; I'm doing this from memory). This replaces the statements movlw b'00001110' movwf TMR1CON Not terribly efficient, but that's all I have. Furthermore, you want to write your interrupt handler in assembly. If you don't it can cause HUGE problems, because the PICBasic code IS NOT REENTRANT (according to the manual, at least). This means that if you call the LCDOut code during your interrupt, and the interrupt occured during and LCDOut call in the main program, when you return to the main program, some of the hidden registers that PICBasic sets up for use during LCDOut will contain unexpected values. You can do Basic-based interrupts, but those can cause problems if you use busy waits (for example, the Pause and Pauseus commands) in your program, since with the "On Interrupt" command, interrupts aren't handled until AFTER the execution of the current command, and that means that if the interrupt happens in the middle of a long Pause statement, it can be quite some time before that interrupt is serviced. I hope this helps; if it's confusing, send me an e-mail and I'll try and send you the code example I've come up with over the last few days for the 16F876. Mike H. _________________________________________________________________ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body