problems with the 18F25J50 USB

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
HjH
Posts: 108
Joined: Sat Jul 03, 2010 4:38 pm
Been thanked: 2 times

problems with the 18F25J50 USB

Post by HjH »

Hi,

I have problems with the 18F25J50 USB.

My HI-TECH Compiler braeks with errors:

Build C:\Projekte_Flowcode\PIC_18F2xJ50\C_Formular\C_Formular for device 18F25J50

Using driver C:\Program Files (x86)\HI-TECH Software\PICC-18\PRO\9.65\bin\picc18.exe

Make: The target "C:\Projekte_Flowcode\PIC_18F2xJ50\C_Formular\USBTest.p1" is out of date.

Executing: "C:\Program Files (x86)\HI-TECH Software\PICC-18\PRO\9.65\bin\picc18.exe" --pass1 C:\Projekte_Flowcode\PIC_18F2xJ50\USBTest.c -q --chip=18F25J50 -P --runtime=default --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"

Error [103] C:\Projekte_Flowcode\PIC_18F2xJ50\USBTest.c; 221.57 #error: Target device does not have USB functionality

Error [141] C:\Projekte_Flowcode\PIC_18F2xJ50\USBTest.c; 249.28 die include Datei "USB/pic_utils.h" kann nicht geöffnet werden: No such file or directory






********** Build failed! *********

How I can eliminate this errors. Can You help me


My program is as follows:

//************************************************************************************
//**
//** File name: C:\Projekte_Flowcode\PIC_18F2xJ50\USBTest.c
//** Generated by: Flowcode v4.3.7.63
//** Date: Friday, January 21, 2011 21:58:26
//** Licence: Professional
//** Registered to:
//**
//**
//** http://www.matrixmultimedia.com
//************************************************************************************


#define MX_PIC

//Definitionen für Microcontroller
#define P18F24J50
#define MX_SPI
#define MX_SPI_C
#define MX_SPI_SDI 4
#define MX_SPI_SDO 5
#define MX_SPI_SCK 3
#define MX_UART
#define MX_UART_C
#define MX_UART_TX 6
#define MX_UART_RX 7
#define MX_UART2
#define MX_UART2_A
#define MX_UART2_TX 0
#define MX_UART2_RX 1
#define MX_I2C
#define MX_MI2C
#define MX_I2C_C
#define MX_I2C_SDA 4
#define MX_I2C_SCL 3
#define MX_PWM
#define MX_PWM_CNT 2
#define MX_PWM_TRIS1 trisc
#define MX_PWM_1 2
#define MX_PWM_TRIS2 trisc
#define MX_PWM_2 1
#define MX_PWM_TRIS2a trisb
#define MX_PWM_2a 3

//Funktionen
#define MX_CLK_SPEED 48000000
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic18.h>
#endif

//Konfigurations-Daten
#ifdef _BOOSTC
#pragma DATA 0x300000, 0x8a
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300001, 0xf9
#endif
#ifdef _HI_TECH_C
__CONFIG(1, 0xf98a);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300002, 0x1d
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300003, 0xff
#endif
#ifdef _HI_TECH_C
__CONFIG(2, 0xff1d);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300004, 0x61
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300005, 0xf8
#endif
#ifdef _HI_TECH_C
__CONFIG(3, 0xf861);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300006, 0x81
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300007, 0xf1
#endif
#ifdef _HI_TECH_C
__CONFIG(4, 0xf181);
#endif
#ifdef _BOOSTC
#pragma DATA 0x300008, 0xff
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x300009, 0xff
#endif
#ifdef _HI_TECH_C
__CONFIG(5, 0xffff);
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000a, 0xff
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000b, 0xff
#endif
#ifdef _HI_TECH_C
__CONFIG(6, 0xffff);
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000c, 0xff
#endif
#ifdef _HI_TECH_C
//__CONFIG(, );
#endif
#ifdef _BOOSTC
#pragma DATA 0x30000d, 0xff
#endif
#ifdef _HI_TECH_C
__CONFIG(7, 0xffff);
#endif

//Interne Funktionen
#include "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h"

//Makro-Funktions-Deklarationen
void FCM_PIC_18F2xJ50_config_Header();


//Variablen-Deklarationen
char FCV_LF;
char FCV_M_RET;
char FCV_CR;


//Defines:

/**** Macro Substitutions ****
0x12BF = Vendor ID
0xF010 = Product ID
{40,3,'F',0,'l',0,'o',0,'w',0,'c',0,'o',0,'d',0,'e',0,' ',0,'U',0,'S',0,'B',0,' ',0,'S',0,'e',0,'r',0,'i',0,'a',0,'l',0}; = Device Name
{46,3,'M',0,'a',0,'t',0,'r',0,'i',0,'x',0,' ',0,'M',0,'u',0,'l',0,'t',0,'i',0,'m',0,'e',0,'d',0,'i',0,'a',0,' ',0,'L',0,'t',0,'d',0,'.',0}; = Device manufacturer
0 = Version Number A
1 = Version Number B
10 = Enumeration Wait Enable
0 = Enumeration Wait Time
40 = Length of Device Name String
46 = Length of Device Manufacturer String
******************************/

// Component Defines
#define MX_VID 0x12BF //Eg 0x04D8
#define MX_PID 0xF010 //Eg 0x000C

#define MX_VERSION (1 << 8) + 0 //Eg 0x0200 = 2.0
#define MX_ENUMTIME 10 //Eg 1 - 255
#define MX_ENUMWAIT 0 //Eg 1 or 0


// Device name and manufacturer
char MX_USBNAME[40] = {40,3,'F',0,'l',0,'o',0,'w',0,'c',0,'o',0,'d',0,'e',0,' ',0,'U',0,'S',0,'B',0,' ',0,'S',0,'e',0,'r',0,'i',0,'a',0,'l',0};
char MX_USBMFR[46] = {46,3,'M',0,'a',0,'t',0,'r',0,'i',0,'x',0,' ',0,'M',0,'u',0,'l',0,'t',0,'i',0,'m',0,'e',0,'d',0,'i',0,'a',0,' ',0,'L',0,'t',0,'d',0,'.',0};


// Global Defines
#define CDC_TX_BUFFER_SIZE 64
#define CDC_RX_BUFFER_SIZE 64
#define CDC_DATA_ENDPOINT 3
#define USB_HIGHEST_EP 3
#define USB_BUS_POWERED

#ifdef MX_USB_TYPE1 //2455 Family
#define USB_DESCRIPTOR_BASE_ADDRESS 0x400
#define USB_EP0_OUT_ADDR 0x0500
#define USB_EP0_IN_ADDR 0x0508
#define USB_EP2_IN_ADDR 0x0510
#define USB_EP3_OUT_ADDR 0x0518
#define USB_EP3_IN_ADDR 0x0520
#endif

#ifdef MX_USB_TYPE2 //2450 Family
#define USB_DESCRIPTOR_BASE_ADDRESS 0x400
#define USB_EP0_OUT_ADDR 0x0480
#define USB_EP0_IN_ADDR 0x0488
#define USB_EP2_IN_ADDR 0x0490
#define USB_EP3_OUT_ADDR 0x0498
#define USB_EP3_IN_ADDR 0x04A0
#endif

#ifdef MX_USB_TYPE3 //14K50 Family
#define USB_DESCRIPTOR_BASE_ADDRESS 0x200
#define USB_EP0_OUT_ADDR 0x0280
#define USB_EP0_IN_ADDR 0x0288
#define USB_EP2_IN_ADDR 0x0290
#define USB_EP3_OUT_ADDR 0x0298
#define USB_EP3_IN_ADDR 0x02A0
#endif

#ifndef USB_DESCRIPTOR_BASE_ADDRESS
#ifdef _BOOSTC
#pragma error "Target device does not have USB functionality"
#endif
#ifdef HI_TECH_C
#error Target device does not have USB functionality
#endif
#endif

#define USB_EP0_OUT_SIZE 8
#define USB_EP0_IN_SIZE 8
#define USB_EP2_IN_SIZE 8
#define USB_EP3_OUT_SIZE 8
#define USB_EP3_IN_SIZE 8

#define USB_CALLBACK_ON_SOF
#define USB_CALLBACK_ON_DEVICE_CONFIGURED
#define USB_CALLBACK_ON_CTRL_CLASS
#define USB_EP_DATA_CALLBACK

//Serial Number
char MX_SERIAL[10] = {10,3,'0',0,'0',0,'0',0,'1',0};

// USB library includes
#ifdef _BOOSTC
#include <USB/pic_utils.h>
#include <USB/pic_usb_buffer_mgt.c>
#include <USB/pic_usb.c>
#include <USB/usb_cdc_class.c>
#include <USB/usb_config_serial.c>
#endif

#ifdef HI_TECH_C
#include "USB/pic_utils.h"
#include "USB/pic_usb_buffer_mgt.c"
#include "USB/pic_usb.c"
#include "USB/usb_cdc_class.c"
#include "USB/usb_config_serial.c"
#endif


// Variable to hold status of the USB connection
char CDC_USB_status = 0;

// Variable to hold incoming data
char CDC_USB_Rx_String[CDC_RX_BUFFER_SIZE];


void usb_device_configured_callback(void)
{
CDC_USB_status = 1;
}




//USBSerial(0): //Makro-Funktions-Deklarationen

void FCD_USBSerial0_configure_system();
char FCD_USBSerial0_Initialise_Serial();
char FCD_USBSerial0_SendByte(char byte);
char FCD_USBSerial0_SendString(char* String, char MSZ_String);
char FCD_USBSerial0_ReadByte(char timeout_ms);
void FCD_USBSerial0_ReadString(char* FCR_RETVAL, char FCR_RETVAL_SIZE, char timeout_ms, char length);



//USBSerial(0): //Makro-Implementierungen


void FCD_USBSerial0_configure_system()
{
kill_interrupts(); // turn off interrupts just in case
usb_cdc_setup();
usb_setup();
turn_peripheral_ints_on();
turn_global_ints_on();
}

char FCD_USBSerial0_Initialise_Serial()
{
uns16 delay_counter;

usb_configure_structures();
FCD_USBSerial0_configure_system();

usb_enable_module();

delay_counter = 0;

#if MX_ENUMWAIT == 1

while(CDC_USB_status == 0 && delay_counter < 10000) //Wait for USB to startup and enumerate
{
delay_counter = delay_counter + 1;
delay_10us(MX_ENUMTIME); //Max wait
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
delay_10us(MX_ENUMTIME);
}

if (CDC_USB_status == 1)
return 0;
return 0xFF;

#else

while(CDC_USB_status == 0);

#endif
return 0;
}

char FCD_USBSerial0_SendByte(char byte)
{
unsigned int timeout = 0;

while (usb_cdc_tx_empty() == 0 && timeout < 32000) //Wait for outgoing buffer to empty
timeout = timeout + 1;

if (timeout == 32000) //Pipeline full or disconnected
return 1;

usb_cdc_putc(byte);
return 0;
}

char FCD_USBSerial0_SendString(char* String, char MSZ_String)
{
unsigned int timeout = 0;

while (usb_cdc_tx_empty() == 0 && timeout < 32000) //Wait for outgoing buffer to empty
timeout = timeout + 1;

if (timeout == 32000) //Pipeline full or disconnected
return 1;

usb_cdc_print_str(String);
return 0;
}

char FCD_USBSerial0_ReadByte(char timeout_ms)
{
static char position = 0;
static char length = 0;
char retval = 255;
char waitforever = 0;

if(timeout_ms == 255)
waitforever = 1;

if (position == length) // end of local string?
{
position = 0;

length = usb_cdc_rx_avail(); // get length of incoming data string

while (length == 0 && (timeout_ms || waitforever)) // wait for timeout_ms
{
Wdt_Delay_Ms(1);
length = usb_cdc_rx_avail(); // get length of incoming data string
timeout_ms = timeout_ms - 1; // decrement timeout_ms
}

if(length == 0)
return (retval); // return no data flag 255 / 0xFF

usb_ep_get_rx_buffer(length, CDC_USB_Rx_String); // copy data string to local buffer
}

retval = CDC_USB_Rx_String[position];

position = position + 1;

return (retval);
}

void FCD_USBSerial0_ReadString(char* FCR_RETVAL, char FCR_RETVAL_SIZE, char timeout_ms, char length)
{
char waitforever = 0;
char i;
char Rx_Length;

if(length > FCR_RETVAL_SIZE)
length = FCR_RETVAL_SIZE;

if(timeout_ms == 255)
waitforever = 1;

while (timeout_ms || waitforever)
{
Rx_Length = usb_cdc_rx_avail(); // get length of incoming data string
if (Rx_Length)
{
if (Rx_Length > length)
Rx_Length = length;

usb_ep_get_rx_buffer(Rx_Length, FCR_RETVAL); // copy data string to local buffer

if (Rx_Length < length)
FCR_RETVAL[Rx_Length] = 0; //Add null character to end of string
return;
}
else
{
Wdt_Delay_Ms(1);
timeout_ms = timeout_ms - 1;
}
}
}

//Makro-Implementierungen

void FCM_PIC_18F2xJ50_config_Header()
{
//Konfiguriert den 18F2xJ50

//Configuration CPU System Clock extern und RTCC intern
//C-Kode:
__CONFIG(1,PLLDIV_3 & CPUDIV_OSC1 & XINST_OFF & WDTEN_OFF);
__CONFIG(2,OSC_HSPLL & T1DIG_OFF & FCMEN_OFF);
__CONFIG(3,RTCOSC_INTOSCREF & DSWDTEN_OFF);


//Enhanced PWM CCP1 Output Configuration bits
//C-Kode:
TRISB = TRISB & 0x11111011;// RB2
RPOR5 = 14; // ECCP1 PWM Output Channel A on PIN RP5


//Enhanced PWM CCP2 Output Configuration bits
//C-Kode:
TRISB = TRISB & 0x11110111; // RB3
RPOR6 = 18; // ECCP2 PWM Output Channel A on PIN RP6


//PWM 1 enable
//Aufruf Komponenten-Makro: PWM(0)::Enable(1)
FCD_PWM0_Enable(1);


//PWM enable 2
//Aufruf Komponenten-Makro: PWM(0)::Enable(2)
FCD_PWM0_Enable(2);


//Zeilenrücklauf für RS232
//Berechnung:
// LF = 10
// CR = 13
FCV_LF = 10;
FCV_CR = 13;


}

void main()
{

//Initialisierung
ancon0 = 0xFF;
ancon1 = 0x1F;


//Interrupt-Initialisierungs-Kode



//
//Makro-Aufruf: PIC_18F2xJ50_config_Header
FCM_PIC_18F2xJ50_config_Header();


//
//Schleife: While m_ret = 255
while (1)
{
//
//Aufruf Komponenten-Makro: m_ret=USBSerial(0)::Initialise_Serial
FCV_M_RET = FCD_USBSerial0_Initialise_Serial();


if ((FCV_M_RET == 255) == 0) break;
}


//
//Schleife: While 1
while (1)
{
//
//Aufruf Komponenten-Makro: m_ret=USBSerial(0)::SendString("Test, ")
FCV_M_RET = FCD_USBSerial0_SendString("Test, ",6);


//
//Output: 1 -> C2
trisc = trisc & 0xfb;
if (1)
portc = (portc & 0xfb) | 0x04;
else
portc = portc & 0xfb;


//
//Warten: 500 ms
Wdt_Delay_Ms(255);
Wdt_Delay_Ms(245);


//
//Output: 0 -> C2
trisc = trisc & 0xfb;
if (0)
portc = (portc & 0xfb) | 0x04;
else
portc = portc & 0xfb;


//
//Warten: 500 ms
Wdt_Delay_Ms(255);
Wdt_Delay_Ms(245);


}


mainendloop: goto mainendloop;
}

void MX_INTERRUPT_MACRO(void)
{
usb_handle_isr();

}

HjH
Posts: 108
Joined: Sat Jul 03, 2010 4:38 pm
Been thanked: 2 times

Re: problems with the 18F25J50 USB

Post by HjH »

addition:

Error [103] C:\Projekte_Flowcode\PIC_18F2xJ50\USBTest.c; 221.57 #error: Target device does not have USB functionality

1. The 18F25J50 have a USB functionality. With MLAB C can I use the USB Serial interface.
2. The Error 103 say the "Target device does not have USB functionality"

#ifdef HI_TECH_C
#error Target device does not have USB functionality
#endif

The cause of a fault is that "USB_DESCRIPTOR_BASE_ADDRESS" is not defined

3. In USBSerial.c is not defined the 18F25J50, only the 2450 Family

Can someone help me to eliminate the error

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: problems with the 18F25J50 USB

Post by Benj »

Hello,

We are looking at releasing a update for v4 in the next month or so that will allow BoostC to compile to these devices and support the USB. For now I will see if I can get you up and running with the HiTech compiler.

First of all here is an up to date FCD file for the device. Simply copy it into your "Flowcode v4\FCD" directory.
18F25J50.fcd
(12.8 KiB) Downloaded 290 times
You will also need to copy the USB folder "Flowcode v4\BoostC\Include\USB" to the HiTech compiler directory

eg. C:\Program Files\HI-TECH Software\PICC-18\PRO\9.63\include\USB

Let me know how you get on.

HjH
Posts: 108
Joined: Sat Jul 03, 2010 4:38 pm
Been thanked: 2 times

Re: problems with the 18F25J50 USB

Post by HjH »

Hallo,

I did all what you said in the e-mail, although the error is the same

Error [103] C:\Projekte_Flowcode\PIC_18F2xJ50\USBTest.c; 221.57 #error: Target device does not have USB functionality

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: problems with the 18F25J50 USB

Post by Benj »

Hello,

The new FCD should stop the error message from appearing. YOu may want to check that near the top of your C code is a define stating the USB type.

#define MX_USB_TYPE1

I have tested this device with the USB components using the new version of BoostC and they are working well so hopefully we can get the update out ASAP.

Regarding HiTech the USB components should also work correctly but the first step is figuring out why the USB not declared error is happening.

HjH
Posts: 108
Joined: Sat Jul 03, 2010 4:38 pm
Been thanked: 2 times

Re: problems with the 18F25J50 USB

Post by HjH »

Hello,

I insert the code "#define MX_USB_TYPE1" in the programm and build it. Then I got the error message:

Warning [362] include\USB/pic_usb_buffer_mgt.c; 97.13 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb_buffer_mgt.c; 109.13 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb_buffer_mgt.c; 117.13 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb_buffer_mgt.c; 127.14 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb_buffer_mgt.c; 147.14 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb.c; 270.40 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb.c; 289.31 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb.c; 309.31 "&" überflüssigerweise auf Feld angewandt
Error [317] include\USB/pic_usb.c; 335.10 "(" erwartet
Error [192] include\USB/pic_usb.c; 335.15 undefinierter Bezeichner/Variablenname "descriptor_type"
Warning [362] include\USB/pic_usb.c; 413.47 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/pic_usb.c; 496.59 "&" überflüssigerweise auf Feld angewandt
Warning [362] include\USB/usb_cdc_class.c; 98.30 "&" überflüssigerweise auf Feld angewandt
Error [195] include\USB/usb_cdc_class.c; 107.1 Syntaxfehler in Ausdruck
Error [312] include\USB/usb_cdc_class.c; 107.1 ";" erwartet
Warning [362] include\USB/usb_cdc_class.c; 115.28 "&" überflüssigerweise auf Feld angewandt
Warning [362 ]include\USB/usb_cdc_class.c; 121.35 "&" überflüssigerweise auf Feld angewandt
Error [195] include\USB/usb_cdc_class.c; 135.1 Syntaxfehler in Ausdruck
Error [312] include\USB/usb_cdc_class.c; 135.1 ";" erwartet
Error [196] include\USB/usb_cdc_class.c; 197.17 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 202.26 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 203.32 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 203.57 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 208.12 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 233.27 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 233.60 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 233.85 struct/union erforderlich
Error [196] include\USB/usb_cdc_class.c; 261.12 struct/union erforderlich
Warning [36c\include\USB/usb_cdc_class.c; 285.35 "&" überflüssigerweise auf Feld angewandt
Error [195] include\USB/usb_config_serial.c; 237.1 Syntaxfehler in Ausdruck
Error [312] include\USB/usb_config_serial.c; 237.1 ";" erwartet
Error [196] USBTest.c; 290.32 struct/union erforderlich
Error [196] USBTest.c; 290.57 struct/union erforderlich
Warning [361] USBTest.c; 462.1 Funktion wurde implizit as int deklariert
Warning [359] USBTest.c; 516.47 nicht erlaubte Umwandlung between pointer types

User avatar
Steve
Matrix Staff
Posts: 3434
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: problems with the 18F25J50 USB

Post by Steve »

If you can post your FCF and C code file, it will help us work out exactly why you are having this problem.

HjH
Posts: 108
Joined: Sat Jul 03, 2010 4:38 pm
Been thanked: 2 times

Re: problems with the 18F25J50 USB

Post by HjH »

I send You in the attachment the FCF and C code file

Comment:

I write the config_header only, because the Flowcode configuration can't set the configuration of the 18F25J50.
In addition I wanted the second PWM benefit. Other errors I change manually.

1. In the "void FCD_RS2320_SendRS232String(char* String, char MSZ_String)" you mast replace the "#ifdef HI_TECH_" through "#ifdef HI_TECH_C"
2. The TMR1CS and ALRMEN are not declared
#define TMR1CS T1CONbits.TMR1CS
#define ALRMEN ALRMCFGbits.ALRMEN
3. In 18F14K50 program code there are similar error

This error did not expected, therefore to be hard to find.
Attachments
USBTest.c
(11.47 KiB) Downloaded 274 times
USBTest.fcf
(8 KiB) Downloaded 287 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: problems with the 18F25J50 USB

Post by Benj »

Hello,

I have found the problem with the configuration of these devices and this is now being fixed. I should have a fix for this soon.

Regarding the USB components, they will not currently work with the HiTech compiler as they rely on a library of files that are all written specifically for the BoostC compiler.

To get around this we will either have to update the USB library to include HiTech or we will have to update Flowcode and it's compiler to allow for the newer devices.

I will put this to the powers that be and see what we can do for you.

In the mean time would it be possible for you to use one of the slightly older yet supported devices eg 18F2550? I know they are a bit more expensive but they should be almost pin compatible with the 18F25J50 device. I think the major difference is the way the Vusb pin works and the lack of the VDDcore pin on the standard 2550.

Post Reply