Jump to content

coldfusion99

EstablishedMember
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About coldfusion99

  • Rank
    Newbrie
  1. According to Microchip's AN566, I need to read the contents of PORTB and store it in PORTB to end mismatch in PORTB that invokes RBINT. This is a snippet from Example 2 of AN566. CLR_RBINTF MOVF PORTB, 1 ;Read PortB (to itself) to end mismatch ;condition How do I do the above statement using Boost C? Thanks in advance.
  2. #include <system.h> #pragma CLOCK_FREQ 10000000 #pragma DATA _CONFIG, _CP_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC & _LVP_OFF void interrupt(void) { if (intcon.rbif) //if RBINT is invoked { if (portb.4) //rising edge on RB.4? { portb = portb; clear_bit(intcon, rbif); if (porta.0) { clear_bit(porta, 0); } else { set_bit(porta, 0); } } else //falling edge on RB.4...just clear interrupt flag and exit { portb=portb; clear_bit(intcon, rbif);
  3. Dave, can you post a simple but full program that flashes LED attached to Porta.0 say 1 sec. on & 1 sec. off? preferably for 874A? at 10 MHz? Thanks much in advance.
  4. #include <system.h> void main() { trisb = 0; //configure port B portb = 0; adcon1 = 0x06; //turn off A/D trisa = 0; //porta is output while( 1 ) //endless loop { porta = 0xff; } } Hello all, I am thoroughly frustrated. The above code should turn off the A/D in 16F874A at 10 MHz and turn on LEDs attached to PORTA. It does not. What *%$#@ is the problem? Thanks in advance.
  5. You also need to set the device configuration correctly, like oscillator type, disable watchdog etc. Take a look at some of the supplied BoostC sample programs and go from there. Regards Dave <{POST_SNAPBACK}> Picxie, How do you change it to digital ports?
  6. You also need to set the device configuration correctly, like oscillator type, disable watchdog etc. Take a look at some of the supplied BoostC sample programs and go from there. Regards Dave <{POST_SNAPBACK}> Dave, That's exactly what I did. I modified an example program that came with Source Boost C. i.e. randtest.c All I did was comment out everything, and just add a line to turn one LED on. Then I build successfully. Of course, I chose the right target, Freq. Then I program the chip. All's OK, except the program does not do what I expect which is tu
  7. I added trisa. The code is #include <system.h> trisa=0x00; void main(void) { set_bit(porta, 0); } It still does not work. My problem may be more basic. What is the sequence in starting a project and adding a c source file? Can someone please help this newbie with step by step instrux? Thanks.
  8. Here is a simple program. It builds ok. But I use another party's programmer (ISP Pro by BasicMicro). I load the hex file generated by SourceBoost and program it on my target (16F874A, 10 MHz). But nothing happens. The programmer thinks it programmed, but the LED is not lit. The programmer, PIC etc. is working because I can program in MBasic and it works just fine. What am I doing wrong? Here is the source code in C: #include <system.h> void main() { while (1) { set_bit(porta,1); //delay_s(10); //clear_bit(porta, 0); //delay_s(100); } }
×
×
  • Create New...