This is a multipart message in MIME format. ------=_NextPart_000_024E_01CAEA3A.FEBC8190 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Jason, I have highlighted a #DEFINE in your source code (in red characters) that looks like it may not belong. Is that a valid DEFINE? I am not a "C" expert, but it looks strange to me. I don't know if this is The problem, but it may be 'a' problem Regards, Jim -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Jason White Sent: Sunday, May 02, 2010 8:39 PM To: Microcontroller discussion list - Public. Subject: Re: [PIC] Re: LCD Troubles ... Fixed selected OSC problem Fixed delay_ms , delays 1 ms still does nothing ? what have I done wrong this time ? On Sun, May 2, 2010 at 8:59 PM, jim wrote: > Jason, > > 1 NOP = Oscillator frequency / 4 ie... 4 Mhz oscillator / 4 = 1uS, so > 1 NOP would be 1uS in this case. > If you're using an 8Mhz oscillator, then 1 NOP would be 500 nS. 12Mhz > would be 333nS, and so on. > > Regards, > > Jim > > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On > Behalf Of Jason White > Sent: Sunday, May 02, 2010 7:51 PM > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] Re: LCD Troubles ... > > How would I calculate how long 1 nop takes ?' > > never had problems with MCLR , I've never herd of problems like that ... > > -- > Jason White - Python and C++ Programmer > -- > http://www.piclist.com PIC/SX FAQ & list archive View/change your > membership options at http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com PIC/SX FAQ & list archive View/change your > membership options at http://mailman.mit.edu/mailman/listinfo/piclist > -- Jason White - Python and C++ Programmer ------=_NextPart_000_024E_01CAEA3A.FEBC8190 Content-Type: text/plain; name="main_blink RED.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="main_blink RED.txt" #include // FIELD TEST /** ** Processor pic16f690 @ 4 MHz ** SDCC Compiler=20 **=20 ** IO 18 pins ** PORTA RA0-5 : 6 pins// ** PORTB RB4-7 : 4 pins ** PORTC RC0-7 : 8 pins ** ** Author Jason White ** Copyright (c) 2010 Jason White ** whitewaterssoftwareinfo@gmail.com , w-w-soft.07x.net **/ // Configurations typedef unsigned int config; config at 0x2007 __CONFIG =3D _INTRC_OSC_NOCLKOUT// internal 32 khz OSC & _IESO_OFF // no need for external OSC & _PWRTE_ON // power up timer & _WDT_OFF // chip not sleeping , no = need & _CP_OFF // no code protection = (the chip is not rewritable under yes) & _CPD_OFF // no data protection & _MCLRE_OFF // use external reset ? & _BOR_OFF // using batterys , allow = low voltage ; int i=3D0; #define DB4 RC0 #define DB5 RC1 #define DB6 RC2 #define DB7 RB4 #define RS RA0 #define RW RA1 #define EN RA2 #define ENABLE EN=3D1;delay_ms(15);EN=3D0; #define DELAY delay_ms(15); void delay_ms(unsigned long loop) // 4mhz , .001*1000=3D1 { unsigned long j=3D0; loop*=3D100; // 100 * 10 NOPs =3D 1000 =09 for (j=3D0;j < loop;j++) { __asm nop nop nop nop nop nop nop nop nop nop __endasm; } } void cmd(unsigned char c) { if(c & 0x80) DB7=3D1; else DB7=3D0; if(c & 0x40) DB6=3D1; else DB6=3D0; if(c & 0x20) DB5=3D1; else DB5=3D0; if(c & 0x10) DB4=3D1; else DB4=3D0; ENABLE; if(c & 0x08) DB7=3D1; else DB7=3D0; if(c & 0x04) DB6=3D1; else DB6=3D0; if(c & 0x02) DB5=3D1; else DB5=3D0; if(c & 0x01) DB4=3D1; else DB4=3D0; ENABLE; delay_ms(15); } void main() { =09 PORTA =3D 0x00; PORTB =3D 0x00; PORTC =3D 0x00; =09 TRISA =3D 0x00; // x x x 0 0 0 0 0 TRISB =3D 0x00; // 0 0 0 0 0 x x x TRISC =3D 0x00; // 0 0 0 0 0 0 1 1 =09 ANSEL =3D 0x00; ANSELH=3D 0x00; =09 RS =3D 0; RW =3D 0; EN =3D 0; DELAY; DELAY; // // FS=3DFunction Set // DS=3DDisplay Set // EMS=3D Entry Mode Set // cmd(0x3c); // FS 4 bit mode , 2 line , 5x7 cmd(0x0f); // DS Display On,Cursor On, Blink On cmd(0x07); // EMS Increment to Right , Shift W/ Display cmd(0x01); // clear while (1) {=09 } } ------=_NextPart_000_024E_01CAEA3A.FEBC8190 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist ------=_NextPart_000_024E_01CAEA3A.FEBC8190--