Trouble with sample FLOWCODE project

Moderator: Benj

Post Reply
bmaynad
Posts: 2
Joined: Tue Aug 06, 2013 9:46 pm
Contact:

Trouble with sample FLOWCODE project

Post by bmaynad »

Hello,

I am new to PIC programming. I recently purchased a PICDEM kit made by Microchip. It shipped with PICkit 3 as the USB programing device. Although this isn't a new product, none of the documentation seems to line up properly. On the CD that came with the product it references FLOWCODE 3, however I am working with FLOWCODE 5 trial version.

The problem is that when I try the following project;

http://ww1.microchip.com/downloads/en/D ... 41381B.pdf
(this is called "PICDEM Lab Flowcode Companion Guide")

I get an error message;

HEX File not foundReturn code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
FINISHED

The program simulates but will not load on the device.

Does anyone have any suggestions on this?

Thanks,

Ben

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Trouble with sample FLOWCODE project

Post by medelec35 »

Hi Ben,
It would be helpful if you can post the flowchart your having an issue with, then we can help you further.

Martin
Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Trouble with sample FLOWCODE project

Post by kersing »

Ben,

I vaguely recall the PICkit3 programmer batch file having issues with directory names with spaces in them. Is you project stored in a directory with spaces in the path? If so, could you try a directory without spaces?

Regards,

Jac
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

bmaynad
Posts: 2
Joined: Tue Aug 06, 2013 9:46 pm
Contact:

Re: Trouble with sample FLOWCODE project

Post by bmaynad »

Hello,

Here is a copy of my program in C.

//************************************************************************************
//**
//** File name: C:\Users\bmaynard\Desktop\PICDEM\FlowCODE5\Flowcode Project\Flowcode1.c
//** Title:
//** Description:
//**
//** Generated by: Flowcode v5.1.0.0
//** Date: Tuesday, August 06, 2013 21:53:43
//** Licence: Free version
//**
//** ***FREE/DEMO VERSION***
//**
//**
//** NOT FOR COMMERCIAL USE
//**
//** http://www.matrixmultimedia.com
//**
//************************************************************************************


#define MX_PIC

#define MX_USES_UINT8 1
#define MX_USES_SINT16 0
#define MX_USES_CHAR 0
#define MX_USES_FLOAT 0
#define MX_USES_SINT32 0
#define MX_USES_BOOL 1
#define MX_USES_UINT16 0
#define MX_USES_UINT32 0
//Defines for microcontroller
#define P16F690
#define FC_CAL_PIC
#define MX_ADC
#define MX_ADC_TYPE_3
#define MX_ADC_BITS_10
#define MX_EE
#define MX_EE_TYPE2
#define MX_EE_SIZE 256
#define MX_SPI_1
#define MX_SPI_1_MISO_PORT portb
#define MX_SPI_1_MISO_TRIS trisb
#define MX_SPI_1_MISO_PIN 4
#define MX_SPI_1_MOSI_PORT portc
#define MX_SPI_1_MOSI_TRIS trisc
#define MX_SPI_1_MOSI_PIN 7
#define MX_SPI_1_CLK_PORT portb
#define MX_SPI_1_CLK_TRIS trisb
#define MX_SPI_1_CLK_PIN 6
#define MX_SPI_1_SS_PORT portb
#define MX_SPI_1_SS_TRIS trisb
#define MX_UART_1
#define MX_UART_1_TX_PORT portb
#define MX_UART_1_TX_TRIS trisb
#define MX_UART_1_TX_PIN 7
#define MX_UART_1_RX_PORT portb
#define MX_UART_1_RX_TRIS trisb
#define MX_UART_1_RX_PIN 5
#define MX_I2C
#define MX_MI2C
#define MX_I2C_1
#define MX_I2C_1_SDA_PORT portb
#define MX_I2C_1_SDA_TRIS trisb
#define MX_I2C_1_SDA_PIN 4
#define MX_I2C_1_SCL_PORT portb
#define MX_I2C_1_SCL_TRIS trisb
#define MX_I2C_1_SCL_PIN 6
#define MX_PWM
#define MX_PWM_CNT 1
#define MX_PWM_PSCA1
#define MX_PWM_PSCA4
#define MX_PWM_PSCA16
#define MX_PWM_1_PORT portc
#define MX_PWM_1_TRIS trisc
#define MX_PWM_1_PIN 5

//Functions
#define MX_CLK_SPEED 4000000
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif

//Configuration data
#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3ff3
#endif
#ifdef HI_TECH_C
__CONFIG(0x3ff3);
#endif

//Internal functions
#include "C:\Program Files (x86)\Flowcode\v5\FCD\internals.c"

//Macro function declarations


//Variable declarations
#define FCV_TRUE (1)
#define FCV_FALSE (0)



#include "C:\Program Files (x86)\Flowcode\v5\CAL\includes.c"

//Macro implementations



void main()
{
//Initialization
ansel = 0;
anselh = 0;


//Interrupt initialization code
option_reg = 0xC0;


//Loop
//Loop: While 1
while (1)
{

//Output
//Output: 0b01010101 -> PORTC
trisc = 0x00;
portc = (85);


}

mainendloop: goto mainendloop;
}

void MX_INTERRUPT_MACRO(void)
{
}

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Trouble with sample FLOWCODE project

Post by medelec35 »

Hi Ben,
You stated you had trouble with sample FLOWCODE project.

So for us to help you, it would be best for you to post the flowchart in question.
Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Trouble with sample FLOWCODE project

Post by kersing »

Ben,

Also, could you attach (use "Upload attachment" TAB below the 'Preview' and 'Submit' buttons) the txt file with all compiler messages generated when you are trying to translate the flowchart?

Regards,

Jac
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

Post Reply