Compatibility of EB055 with 28pin PIC24FJ64GB002?

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

Moderators: Benj, Mods

Post Reply
randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

Hi
I have just received some PIC24 chips and now realize that the EB055 I have may not be compatible with the D9 ports on the EB064 that I use for programming. I have written but not tested code (attached) for testing the EB085 and sending data to my PC terminal software. However, the D+,D- pins on the PIC are 21 and 22, or RB10 and RB11, i.e. pins 3 and 4 on a RBH D9 assignment. This is not what the two jumper options on the EB055 provide (A:6, 5, or B:8, 7). Before I charge ahead and built a bespoke D9 to USB B connector can you confirm that I do need one.
ADCto24FJ64GB002USB.fcfx
(11.64 KiB) Downloaded 354 times

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

Hi
I have hooked up the EB055 to EB064 carrying a PIC24FJ64GB002, connecting a D9 plug to the D+, D- and VUSB pins of the A patch (to D9 pins 3,4,5 = B10, B11, B13/VUSB). My PC recognises the USB serial connection but won't accept the driver file generated by Flowcode 6, attached as a text file. How do I get the "Install New Hardware" function as on the MM USB example video working. The Windows "install new driver" function refuses to do the job and says the non-existent driver is fine.
Attachments
Flowcode_USB_Serial_Driver.txt
(2.34 KiB) Downloaded 313 times

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

To complete the story I have used MM's "basic USB comms." teaching aid and converted the fcf file to an fcfx file for F6 (I only have a PIC16bit licence) using the same PIC24FJ as above. I also opened the fcf file in F5 for 8 bit PICs and had no difficulty generating a driver file. I now realize that the F6 for 16bit PICs is unable to create such a mchpcdc.inf file - it merely generates a text file labelled Serial_USB_Driver that is not recognised by my PC as a driver. I tried using the .inf file with the recompiled fcfx file but was unable to because there are "errors" that I can't fathom out. I have attached an image of the compiler output showing the errors. Maybe F6 does binary maths differently, and is not able yet to do USB?
errors.JPG
(126.08 KiB) Downloaded 2681 times

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: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by kersing »

I have used FC6 to successfully create USB Comm for 8 bit PIC (I do not have 16 bit devices at hand). After connecting the USB connector Windows 7 tried to install a driver from Windows Update. This failed (no surprise). Next I opened Device Manager (Right click 'Computer' in the start menu, choose 'Properties', choose 'Device Manager' in the left column), selected the device and in the right click menu choose 'Update drivers'. Selected 'Search on my computer' and browsed to the correct folder. Got a warning about the driver not being signed, proceeded anyway and after a wait the installation was successful.

As FC6 is the same for 8 and 16 bit PIC you should be able to create a driver without any problem. To test I've created an 24FJ64GB002 project, driver file created is fine. Code compiles without a problem.

Perhaps you could upload your flowcode file so we're able to check what might be the issue?
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

inf_file.JPG
inf_file.JPG (154.51 KiB) Viewed 8532 times
Kersing
I have tried installing the driver as you suggest and Windows 7 assures me it has done so but the device remains "unknown". The F6 program I am trying to set up is attached. It is a F6 translation of MM's example from their USB serial collection. I have tried many times to create new driver in USB serial/properties/driver/yes. It appears to do so - here it is as an image (uploading .inf files not allowed) but Windows 7 won't install it. I don't understand why.
USB_Demo_v6.fcfx
(5.56 KiB) Downloaded 353 times

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: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by kersing »

The driver file looks fine.

The device will not be recognized because (at least for the provided example) the oscillator is not setup properly. As a result the USB part of the controller can not communicate with the host properly and the device will not be recognized.
Try setting the configuration to:
settings.jpg
(154.38 KiB) Downloaded 2677 times
(Can't test, so no guarantees)

The compile errors are caused by improper conversion of the USB properties (Device Name and Manufacturer), part of the variable declaration is included. These values should only contain ASCII characters, current:

Code: Select all

Device Name: rom char* MX_USBNAME = {40,3,'Flowcode USB Serial
Manufacturer: rom char* MX_USBMFR = {46,3,'Matrix Multimedia Ltd.
Should be:

Code: Select all

Device Name: Flowcode USB Serial
Manufacturer: Matrix Multimedia Ltd.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

Kersing
Thanks for the advice. Not wanting to look a complete idiot I have spent some time working out what's wrong. I used my Flowcode 5 licence to check an MM USB test file on a PIC18F2455 on the EB006 and the test worked perfectly. I have also check in detail the driver files produced by F5 and F6 for a USB serial test program and they are identical (after making the names ascii only, as you suggested). I also checked the oscillator settings and changed the "divide by" to suit the 12MHz crystal on the EB064. This made it much easier to upload the assembly code to the chip (it was divide by 48)! I also tried an expensive 20MHz crystal in case I had a dud. In all cases the code uploaded OK and the PC acknowledged a device but refused to upload the driver. I am also certain I have the USB B socket wired up correctly. Maybe I should stick to geology.

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

I have been unable to test EB085 with F6 on an 8bit PIC (no licence). However, here is a Flowcode5 program for testing it with a 18F2455. In the course of developing this code I have discovered that the SPI uses non-volatile memory (NVM) to store data and this requires that both the ADC's bar CS pin and the SPI's NVM need the same trigger (B4). The DAC pin is not used. Sending "upper" and "lower" bytes to the PC seems a little risky but coherent data does arrive at the PC. The clock speed can be increased. Uploading the software to the PIC needs three stages after compiling to HEX: disconnect the B4 to ADC bar CS patch wire, reset the PIC, and then upload the file. The MISO and SCK lines are patched from EB085 to B0 and B1. MOSI is not connected. A switch (EB007) on A1 gives a trigger pulse and the 1s delay stops immediate repeats. The output (100 lines) can be viewed as uncombined bytes using Realterm or a simple VB.NET program can store the data.
ADCto18F2455.fcf
(14.53 KiB) Downloaded 346 times
Now for the 16 bit PIC's...

randomrichard
Posts: 41
Joined: Thu Oct 16, 2008 11:01 am
Has thanked: 21 times
Been thanked: 7 times
Contact:

Re: Compatibility of EB055 with 28pin PIC24FJ64GB002?

Post by randomrichard »

I think the problem with Flowcode 6 and the PIC24FJ64GB002's USB is that unlike the 18F2455, whose USB works (see previous post) and has +3.3V on pin VUSB (14), the 24FJ has only +1.7V on pin VUSB (23) - it should have +3.3V too - so the PC doesn't recognise it. The datsheet describes various means of powering the USB module but I can't see how this would be done in Flowcode/E boards. I have checked by changing the PIC. Any ideas, any one?

Post Reply