Jump to content

nomad6

Members
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About nomad6

  • Rank
    Newbrie
  1. Thanks to Dave and Aegis-tec, I'll give the suggestion of the global variables a try. Its just frustrating that MicroChip will not support or fix this issue. They were less than friendly when I mentioned Source Boost. Thanks again. I wish I would of saved my money and not purchased the ICD 2 device, it was supposed to make life easier, not more complex. Perry
  2. Hi, I just got a response from Micrchip about this issue and they said that its most likely a problem with the COFF file and its a BoostC issue. Perry
  3. I've got the 6.4 licensed unlimited version of BoostC and I'm trying to use my new ICD2 debugger in an existing circuit/design with a 16f628A target running at 4MHz. I've also got the icd2 header for the 628. I've created a project in MPLab and gotten all of the code to compile and libraries to link just fine. I know that the code is good, (it works in the product) but I can't seem to get my variables to display correctly in MPLab. I'm including <icd2.h> in all of my C files, and putting the nops at Org 0, per the bug description I found on this forum. I'm also setting the linker options -rb 0x0001 and -rt 0x7ff, per the comments in the icd2 header. I can single step my code but when I step over a simple instruction like: index = 0; it shows the variable's value at 0xff before the execution and after as well. The index variable (char @ 0x61). The disassemly code looks good too. Can someone please let me know if there are still MPlab issues with SB? I looked in the manual and didn't see anything other than including icd2.h in my files. Comments, help, guidance? Can someone post a "hello world" example showing everything that needs to be done to get the ICD to work? Thanks, Perry
  4. I'm trying to create a set of serial I/O routines which use the UART's interrupt flags to control I/O. I want to remove the burden of serial I/O from my main code. Could someone please take a look at this code and tell me 1) if someone's already done this (link please) otherwise 2) what's wrong with what I've done? I'm using the UART on an 877A @ 20MHz Thanks! ------------- #include <system.h> #pragma CLOCK_FREQ 20000000 #pragma DATA 0x2007, _BODEN_ON & _CP_OFF & _WDT_OFF & _HS_OSC & _LVP_OFF & _PWRTE_ON #pragma OPTIMIZE "0" #define YES 1 #define NO 0 #define BOTH 2 #define Output 0 #define baud_rate 9600 volatile bit LED @ 0x06.1; // B1 volatile bit LED2 @ 0x06.2; volatile bit LEDTris @ 0x86.1; volatile bit LED2Tris @ 0x86.2; int RTC = 0; volatile char serialEnable = NO; volatile char message[30] = {"Hello!\r\n\x00\r\noverflow\r\n!"}; volatile char messagePointer = 0; void puts(char *foo); void portInit(void); void main(void) { portInit(); // Initialize the I/O Ports while(1) { puts("Hello there!\r\n"); // this should repeat every 250 ms delay_ms(250); } } void puts(char *foo) { strcpy(message, foo); messagePointer = 0; serialEnable = YES; set_bit(pir1, TXIF); } void portInit() { option_reg = 0x054; // Assign Prescaler to TMR0, prescaler is /32, also enable pull-ups tmr0 = 0; // Reset the Timer for Start set_bit(intcon, T0IE); // Enable Timer Interrupts LEDTris = Output; LED2Tris = Output; RTC = 0; LED = 0; LED2 = 1; spbrg = 32; set_bit(txsta, TXEN); set_bit(rcsta, CREN); set_bit(rcsta, SPEN); set_bit(intcon, PEIE); set_bit(pie1, RCIE); // enable the receiver interrupt set_bit(pie1, TXIE); // enable the transmitter interrupt clear_bit(pir1, TXIF); // clear the transmitter's flag clear_bit(pir1, RCIF); // clear receiver's flag set_bit(intcon, GIE); // Enable Interrupts } void interrupt (void) { char msgChar; if(test_bit(intcon, T0IF)) // TMR0 Handler set to run as a 1ms interrupt { clear_bit(intcon, T0IF); // Reset Interrupt Flag RTC++; // Increment the Clock if((RTC % 512) == 0) { LED++; LED2++; } } if(test_bit(pir1, TXIF)) // is transmit buffer empty & ready for new character? { if(serialEnable == YES) { clear_bit(pir1, TXIF); if((msgChar = message[messagePointer]) != '\0') { txreg = msgChar; messagePointer++; } else serialEnable = NO; } } if(test_bit(pir1, RCIF)) { clear_bit(pir1, RCIF); } } // End Interrupt Handler
×
×
  • Create New...