PIC18F2550 not programmable with LabVIEW for PIC18F4455

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
BeFu
Posts: 5
Joined: Sun Jan 18, 2009 10:09 am
Location: Germany, Bavaria
Contact:

PIC18F2550 not programmable with LabVIEW for PIC18F4455

Post by BeFu »

Hello all,

I've installed the flowcode 3.0 usb_pack as I'd like to control my PIC18F2550 by LabVIEW. The PIC18F2550 is suggested in the demo presentation of the usb_pack. Unfortunately the flowcode example "USB Slave Demo 3-Byte" of the usb_pack is for the PIC18F4455. After deleting "Output byte2 to portd" from the demo code it should work on the PIC18F2550. I've connected the LCD-display to port A to which byte1 is send. Additional to the simulated LCD-display the "USB Slave" is activated in demo mode of the flowcode.
After selecting the PIC18F2550 as target in the expert mode I try to compile the demo code with the deleted "Output byte2 to portd" to the chip.
There I get the following failure message:

File name: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
Generated by: Flowcode v3.4.7.48
Date: Monday, February 23, 2009 15:45:42
Licence: Professional
Registered to: Bernd Furnier, University of Applied Sciences Cob

http://www.matrixmultimedia.com

Launching the compiler...

D:\Programme\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic18.flowcode.exe -v -t PIC18F2550 "USB Slave Demo 3-Byte PIC18F2550.c"

BoostC Optimizing C Compiler Version 6.70 (for PIC18 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC18 max code size:Unlimited, max RAM banks:Unlimited

USB Slave Demo 3-Byte PIC18F2550.c
Starting preprocessor: "D:\Programme\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" "E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c" -i "D:\Programme\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC18F2550 -la -c2 -o "USB Slave Demo 3-Byte PIC18F2550.pp" -v -d _BOOSTC -d _PIC18
...................................................................................

USB Slave Demo 3-Byte PIC18F2550.c success

success

Return code = 0

Launching the linker/assembler...

D:\Programme\Matrix Multimedia\Flowcode V3\BoostC\boostlink.pic.exe -ld "D:\Programme\Matrix Multimedia\Flowcode V3\BoostC\lib" libc.pic18.lib flowcode.pic18.lib "USB Slave Demo 3-Byte PIC18F2550.obj" -t PIC18F2550 -d "E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave" -p "USB Slave Demo 3-Byte PIC18F2550"

BoostLink Optimizing Linker Version 6.70
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Warning unreferenced functions removed:
FCD_LCDDisplay0_GetDefines in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_LCDDisplay0_PrintASCII in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_LCDDisplay0_Command in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_LCDDisplay0_RawSend in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_LCDDisplay0_Cursor in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_USBSlave0_GetDefines in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_USBSlave0_Check_Rx in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_USBSlave0_Get_Byte in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_USBSlave0_Get_String in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
FCD_USBSlave0_Stop_Slave_Service in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
LCD_263538_Dummy_Function in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c
usb_get_state in: D:\Programme\Matrix Multimedia\Flowcode V3\BoostC\include\USB\pic_usb.c
CUSTOM_Dummy_Function in: E:\BFurnier\E-H\Flowcode\usb_pack\USB Examples Slave\USB Slave Demo 3-Byte PIC18F2550.c

Building CASM file

Memory Usage Report
===================
RAM available:2048 bytes, used:443 bytes (21.7%), free:1605 bytes (78.3%),
Heap size:725 bytes, Heap max single alloc:127 bytes
ROM available:32768 bytes, used:4584 bytes (14.0%), free:28184 bytes (86.0%)

success

Return code = 0

Launching the programmer...

D:\Programme\Matrix Multimedia\Common\PPPv3\PPPv3.exe -cs 2 -nogui "USB Slave Demo 3-Byte PIC18F2550.hex"

Sending program...
Erasing the PICmicro
Writing program memory
..................................................................................................

Writing configuration memory
Programming failed: <6>
That took 26,797 seconds

Return code = 0

FINISHED

Would you tell me please what I've to correct for programming my PIC18F2550 on the e-blocks with the flowcode example for LabVIEW?
As I want to control the PIC18F2550 with labVIEW by using your DLL functions it'll be great if you send me a demo flowcode for the PIC18F2550 which you've already tested successfully.
Thank you very much.
Kind regards,

BeFu
- the target is the way -

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: PIC18F2550 not programmable with LabVIEW for PIC18F4455

Post by Benj »

Hello

Your problem is your configuration settings. In Flowcode click on Chip -> Configuration and then click on the expert mode button.

In here make sure your device is selected and then configure the configuration as appropriate. If you need help with these settings then let me know.

USB Clock Selection - 96MHz PLL/2
CPU Sys CLK Select - No Divide
OSC select - Match this setting to your crystal speed, Note you must use a crystal with one of the values listed here.
(The 19.6608 crystals on our hardware will just lift out without the need for soldering.)
Oscillator - HS: HS+PLL, USB-HS
USB Voltage Regulator - Enabled
Watchdog timer - Disabled
Low Voltage Program - Disabled

The labview examples should work as they currently are when the configuration settings for the chip are correct.

Further to this you will need some way of connecting a USB connector to PORTC of your programmer board. We are releasing a EB055 board this week that does this for you. Alternativley you can make your own design using vero board etc. You will need a Type B USB socket with D- connected to D- on the chip, D+ connected to D+ on the chip, GND connected to VSS on the chip and a 220nF cap going from pin 14 VUSB to GND.

Hope this helps.

BeFu
Posts: 5
Joined: Sun Jan 18, 2009 10:09 am
Location: Germany, Bavaria
Contact:

Re: PIC18F2550 not programmable with LabVIEW for PIC18F4455

Post by BeFu »

Hello Ben,

thank you very much for your quick and detailed answer. I've changed the configuration settings in "expert config screen" according to your suggestions, see the attached screenshot.
I don't understand your suggestion about connecting an additional (?) USB connector to PORTC of my PIC18F2550. What do you mean with "vero board"?
I will be glad if you post me a detailed description about connecting an additional (?) USB connector to PORTC of my PIC18F2550 using your EB055. How much costs the EB055? Can I buy the EB055 over the ELEKTOR shop?
Could you send me an video where the programming of the PIC18F2550 for the communication with LabVIEW is shown?
Thank you very much for your help.
Kind regards,

BeFu
Attachments
BeFu - Failure message after modifying configuration according to Bens suggestions.pdf
(82.44 KiB) Downloaded 448 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: PIC18F2550 not programmable with LabVIEW for PIC18F4455

Post by Benj »

Hello

The USB port of the 18F2550 is on PortC of the chip. To connect to the chip via USB you must therefore provide a USB socket to the pins on PortC. This is what the EB055 USB E-Block does. You can also rig one up using Veroboard (Circuit Prototyping Stipboard) If you have parts available such as USB sockets and a 220nF capacitor. The EB055 will be approx Β£15 but I have not had a confirmation on this price yet.

Once the chip has been programmed you can insert a USB cable into the USB socket on PortC and then once the USB has been recognised in Windows you can use the Labview exampes to commuicate with your device.

If the EB055 is not right for you then maybe an ECIO would be better suited. These are directly programmable and come complete with everything you need to get underway with USB functionality.

Post Reply