Help for USB

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

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

Help for USB

Post by HjH »

Hallo,

Flowcode : 6.0.4.0
MCU : 24FJ64GB002
Tact : 32MHz
Communication: USB serial

- I wrote a small programm. You can see that in the attachment.
- I have the new USB-Treiber installed
- I open the "HyperTerminal" and can't open the virtual com

Can you urgently help me
Error_4.JPG
Error_4.JPG (17.9 KiB) Viewed 7778 times
Error_4.JPG
Error_4.JPG (17.9 KiB) Viewed 7778 times
Attachments
USB_Master_24FJ64GB002_Matrix.fcfx
(5.44 KiB) Downloaded 281 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: Help for USB

Post by Benj »

Hello,

What is Windows saying is the problem with the device if you double click the device in device manager?

The small yellow exclamation mark is normally related to a specific problem such as "Device cannot start" or "Device drivers not installed" etc.

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

Re: Help for USB

Post by HjH »

Hello,

if I compile the programm with Flowcode 5 then works it correct. The same programm compiled with Flowcode 6 works not correct.

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: Help for USB

Post by Benj »

Hello,

In the v6 program the watchdog timer is enabled in the configuration settings, this will likely cause problems in the hardware and could be the cause of the yellow warning triangle you are seeing.

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

Re: Help for USB

Post by HjH »

Hello,

I checked my config1 and the watchdog timer is disable. I start the programm and the return of the step "USB_Serial1 Initialise" is not 255. In the Hyper Terminal I can't see the sendstring of USB. With other words the USB send nothing. The USB- Treiber ist the USB-Treiber of Flowcode5

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: Help for USB

Post by Benj »

Hello,

Can you attach your current program with the current config setting and also please could you describe your hardware oscillator setup and I will do what I can to help.

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

Re: Help for USB

Post by HjH »

Hallo,

Flowcode : 6.0.4.0
MCU : 24FJ64GB002
Tact : 32MHz
Communication: USB serial

Configuration Einstellungen:
Config4 = 0xff18
Config3 = 0xf4ff
Config2 = 0x89af
Config1 = 0x3f7f
USB_Master_24FJ64GB002_Matrix.fcfx
(5.85 KiB) Downloaded 405 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: Help for USB

Post by Benj »

Hello,

The Watchdog timer is still enabled in the config settings and should be set to disabled.
config.jpg
config.jpg (106.26 KiB) Viewed 7652 times
Is the LED toggling on and off on the hardware at the correct rate? I think you will have to setup the device to be running at 48MHz to work correctly for USB. If your crystal is 32MHz then you will need to change the config settings to use the external crystal with PLL and then change the dividor setting to give you the 96MHz output. If your using the internal oscillator then this should be the RC with PLL setting. Let me know which method you are using and I will help you to setup the program for the device so it runs at the correct speed for USB to work succesfully.

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

Re: Help for USB

Post by HjH »

Hello,

I work with internal oscillator and the PLL mode. The Takt of the LED is 1Hz, this worked correctly.

If you start the "Project Option" the Watchdog Timer and other flag differ from the last modification without modifiation in the current session.

I checked the the configuration config1 to config4 in the C-code. The settings are in accordance with the data sheet. The Watchdog Timer is off.

If I may set the configuration as in Flowcode5 in the "use additional code" (ergänzenden Code benutzen) then I could take the code form Flowcode5. To the example: _CONFIG2(POSCMOD_XT & I2C1SEL_PRI & IOL1WAY_OFF & OSCIOFNC_ON & FCKSM_CSDCMD & FNOSC_FRCPLL & PLL96MHZ_ON & PLLDIV_NODIV & IESO_OFF). Then in Flowcode5 worked this code correct

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

Re: Help for USB

Post by HjH »

Hello,
I believe Flowcode6 has a bug in the USB Serial, because I transfered the config settings in the Flowcode5 and with this the code run the programm correct.

Brendan
Posts: 243
Joined: Tue Nov 27, 2012 12:53 pm
Location: Cambridge, UK
Has thanked: 140 times
Been thanked: 118 times
Contact:

Re: Help for USB

Post by Brendan »

I'm not sure whether this will help, though I'd personally try a delay after initialising the USB block to guarantee reliable uninterrupted enumeration with the host before messaging. Perhaps you've already tried this?

Maybe this shouldn't make a difference between FC5 and FC6 but its simple to try and rule out if nothing else. If only I had a pound for every time I've heard "shouldn't" :roll: :D


All the best,

Brendan

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

Re: Help for USB

Post by HjH »

Hello

I have insert a delay. The Hyper Terminal don't receive a message. Then I import the Flowcode5 programm in the Flowcode6. The result is the Hyper Terminal don't receive a message. From my view it cannot develop meaningfully the USB application in flowcode5. Therefor Flowcode6 was too expensive

I don't know what you mind with "If only I had a pound for every time I've heard "shouldn't" "

Post Reply