Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 10:23 20 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Strange Case: WakeUp on MX470.64pin

Author Message
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 09:48am 26 Mar 2017
Copy link to clipboard 
Print this post

Hi to everybody

I am using PIC32MX.64pin with firmware 05.03.02. I use pin(51) to simulate wakeup action etc.
If the micro is NOT connected to USB and I do "cpu sleep" after I can use Pin(51), the micro answer correctly and continues to run.
While if I connect micro with USB makes some strange behavior. Sometimes "cpu sleep" It has no effect does not go into sleep. Some time after giving the command "cpu sleep" even if I use the pin (51) does not wake up again and I have to do a reset.
what's the problem ? where am wrong

Thanks
sagt3kEdited by sagt3k 2017-03-27
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3167
Posted: 03:20pm 26 Mar 2017
Copy link to clipboard 
Print this post

You will have trouble if you have an active USB connection and use sleep. This is something I should have mentioned in the documentation.

Sleep is all about saving power in a battery powered application so in a practical situation it should not matter because there is little reason to send the Micromite to sleep if you have an active USB connection.

Geoff
Geoff Graham - http://geoffg.net
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 08:51am 27 Mar 2017
Copy link to clipboard 
Print this post

Hi Geoff

OK Clear, but is it possible to have a variable MM.USB=1 that indicates a USB console connection? Or is it possibile to have no action with "cpu sleep" when is actvie USB connection?
Thanks
sagt3k
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 10:41am 27 Mar 2017
Copy link to clipboard 
Print this post

  sagt3k said  is it possible to have a variable MM.USB=1 that indicates a USB console connection?


I like that. Seconded.
Micromites and Maximites! - Beginning Maximite
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 11:49am 27 Mar 2017
Copy link to clipboard 
Print this post

  Quote  is it possible to have a variable MM.USB=1 that indicates a USB console connection?


? peek(word &HBF885060) and 1


will tell you if the USB is plugged in

1=yes
0=no
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 06:55am 28 Mar 2017
Copy link to clipboard 
Print this post

Hi matherp

I tried with USB console and give me 1 and later with UART on TX/RX as console ... same result=1.
Where is the error?

I'm trying on PIC32MX470H.64pin with MMbasic "5.0302".

Thanks
sagt3k
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8608
Posted: 08:19am 28 Mar 2017
Copy link to clipboard 
Print this post

This is showing power to the VBUS pin-34 (on 64-pin). If you have power on that pin USB is enabled whether you want it or not
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 08:58am 28 Mar 2017
Copy link to clipboard 
Print this post

Hi matherp
Thanks solved.
But I don't know very well PIC32MX/MZ with various pin. But this address(&HBF885060) is equal on all PIC32xx ?
Or Can you think to implement MM.USB ?
Thanks
sagt3k
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 11:10am 18 Sep 2017
Copy link to clipboard 
Print this post

Hi matherp
Concerning PIC32MZ2048EFH 64pin, What is the address to read if connected with USB or no?

Thanks
sagt3k
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024