Hi, I haven't used the 2455 but the second __CONFIG line sets the oscillator to be 4x the crystal - so you should have DEFINE OSC 40 if you are using a 10mhz crystal. If you aren't using a crystal, you'll probably need to change the config settings relating to the oscillator. Now it would seem if this is the problem, you'd be running way to fast, not too slow, but I recommend looking these over for any obvious problems. I didn't find any way of changing config settings in a simple manner with picbasic pro (but I am by no means an expert), so for my project I commented out all the __CONFIG lines in the picbasic pro header file and put them in my code. See: http://www.celestialaudio.com/leoProgrammable/index.html specifically the "library code" link at the bottom. The settings for the board I made are near the top of the file. Hope it helps- J Mark Wotton wrote: > Hello, > > I'm trying to program a PIC 18F2455 chip. I'm using PicBasic Pro as a > frontend, MPLab v7.30 for the assembler, and MPLab icd 2 for the > programmer. A simple testing program to flash a light on and off at 1 > second intervals instead takes 8 seconds: > > ---------------------------------------- > INCLUDE "modedefs.bas" > > define OSC 8 > > TRISA=%00000 > TRISB=%00000000 > TRISC=%11111111 > > StatusLED VAR porta.1 > > LOOP: > high StatusLED > pause 1000 > low StatusLED > pause 1000 > goto LOOP > ------------------------------------------ > > If I change OSC to 4 (or leave it out), the program takes 4 seconds > per transition, so I initially thought I could just set OSC to 1 and > be done with it - this wouldn't compile in PicBasic Pro, however, > giving me the error "Symbol not previously defined (PAUSEUSL)". > > I tried fiddling with some of the constants defined in > C:\pbp\p18f2455.inc, which the generated assembly included: > -------------------------------------------- > INCLUDE "P18F2455.INC" ; MPASM Header > __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & > _USBDIV_2_1L > __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H > __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H > __CONFIG _CONFIG3H, _PBADEN_OFF_3H > __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L > --------------------------------------------- > > Unfortunately, nothing there seemed to have any effect on the timing > at all. Where do you suggest I look next? I'm at a bit of a loss. > > (It's important that the timing be right for this, as I need to use > serial comms to load new data at runtime, and SERIN doesn't seem to > want to work, even when I tried setting the baud rate on the other end > of the serial to 1200 to compensate.) > > Please let me know if I've missed describing anything important, I'm > still quite new to PIC programming. > > Cheers, > Mark > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist