Probably someone else can be more definitive, but here's a quick start: Reload - The PIC is reprogrammed with a compiled hex file. To change the=20 programming. Run - Several possibilities 1: Program execution starting at memory location 0000. 2: In Debug mode, if breakpoints have been inserted, the execution has=20 temporarily stopped at the break point, and can be continued at the next=20 instruction. 3:In Debug it may be possible to move the program pointer to 0000. On 3/12/2011 9:58 AM, Jan-Erik Soderholm wrote: > What is "reload program" ? > Reset ? Re-flash ? > > What is "RUN" ? > > > > > rchadwic wrote 2011-03-12 15:41: > =20 >> I am trying to learn how to use the C18 V3 . 36 compiler to program an >> 18F4550. Using PicKit3 and MPLab V8 . 46 . >> I am trying to use the hardware USART functions to load a single charact= er >> into the PIC and echo it back, repeating the character 30 times in a WHI= LE >> loop. >> The program is shown below. I am trying to declare constant hwi =3D 30. = I have >> tried many ways of locating this, none are successful. >> With the statement located at POSITION A, it does the WHILE loop once; t= o >> repeat requires reloading the program. I am expecting the program to rep= eat >> each time I push RUN; it doesn't. >> With the statement located at POSITION B, I get an OUT OF RANGE indica= tion >> on the Watch window. A count of 30 was expected. Repeat requires reloadi= ng >> the program. >> With the statement located at POSITION C, it will not compile and I get = a >> syntax error that has not responded to typing error checks, research, an= d >> checks of the preceding line of code. >> The MPLAB supplied usart . c routine complies and runs correctly. >> I am doing something stupid that I cannot see. Can someone help me? >> >> My first thought regarding asking for help was the Microchip C18 forum. >> However, I can not post this to that forum as I keep getting a message t= hat >> tells me I am using >> "potentially harmful characters" A query to the forum yielded some >> suggestions but no matter how I parse the post it fails. >> >> /********************************************************************** >> /*This program loads an ascii "W" character into the PIC and repeats it = 30 >> times. */ >> /*uses A CHARACTER*/ >> /* ADDITIONAL NOTES: >> /* Code uses the Peripheral support library available with MCC18 Compile= r >> /* Code Tested on: >> /* Olimex demo board with 18F4550 processor >> /* The microcontroller uses an External Crystal (20 MHz). >> /* >> /* Uses TX pin for transmission and RX pin for reception. >> /* Baud rate of 9600 is configured for 20MHz oscillator frequency >> //**********************************************************************= / >> >> #define USE_OR_MASKS >> #include >> #include >> #include >> //-------------------------------Configuration setting >> ---------------------------------------------- >> >> #pragma config FOSC=3D HS, PLLDIV =3D 5, FCMEN=3DON, WDT=3DOFF, IESO=3DO= FF, XINST=3DOFF, >> LVP=3DOFF >> >> >> char Txdata =3D 'W'; >> int hwi=3D30; //POSITION A Loads OK, counts down and stops at 0 in >> location 06B. Must //reload program to start again. >> >> #define BAUD_RATE_GEN 31 // Fosc =3D 20 MHz, Baud Rate =3D 9600 bps >> >> void main(void) >> { >> >> //int hwi=3D30; //POSITION B "Out of Scope" value shows on Watch window= ; >> counts loops 30 //times and stops at 0 at address 201.Must reload progra= m to >> start again. >> >> OpenUSART(USART_TX_INT_OFF | USART_RX_INT_OFF | USART_ASYNCH_MODE = | >> USART_EIGHT_BIT | USART_CONT_RX | USART_BRGH_LOW, BAUD_RATE_GEN); >> baudUSART(BAUD_8_BIT_RATE | BAUD_AUTO_OFF); >> >> >> //int hwi =3D 30; //POSITION C Syntax Error that responds to nothing >> I change (yet)=09 >> >> while(hwi>0) >> =09 >> { >> WriteUSART(Txdata); // transmit the character >> Delay10KTCYx (0); //Delay about half a second >> hwi--; >> } >> >> CloseUSART(); >> while (1); // end of program >> >> } >> >> >> >> =20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .