I have flowcode 5 and have been trying to get a very simple program to turn on an LED on a PIC with no success.
PIC18F452
Hardware platform - SBC44B http://www.modtronix.com/product_info.p ... cts_id=109
Programming with a ICD2 programmer through MPLAB
10MHz crystal
I have attached the flowcode program I create to turn on a LED connected to Port B6. The program compiles down to .hex with no problems. Then I program the board with MPLAB and the ICD2 again with no problems. I have checked the configuration settings for the device in the flowcode program. Watchdog - Off, Low Voltage programming - off, brown out detection - off I set the clock frequency to 10Mhz. I also set the oscillator to HS and also tried HS-PLL.
I have found that flowcode never seems to remember the oscilator settings ie it always goes back to "RC-OSC2 as RA6" ("configure the chip" tick box is ticked). I guess that this could be my problem but I have no way of fixing it as the software wont let me change it and save it. I have tried changing the config in MPLAB to HS/HS-PLL but this doesnt work - not sure if it should work like that though.
I wrote a program in C18 to turn the same port on and the program works fine so the hardware side of things is OK. Is there a known bug about this?
I have attached the flowcode files for the program I created.
Code: Select all
#include <p18cxxx.h>
void main(void);
void main(void)
{
LATB = 0x00;
TRISB = 0b00000000;
PORTBbits.RB6 = 0;
while(1)
{
PORTBbits.RB6 = 1;
}
}