• AVR Freaks

Helpful ReplyHarmony and ATWINC1500

Author
BillP
Super Member
  • Total Posts : 337
  • Reward points : 0
  • Joined: 2014/09/28 07:53:35
  • Location: CA
  • Status: offline
2018/08/15 13:10:35 (permalink)
0

Harmony and ATWINC1500

I bought a MCHP Curiosity PICMZ EF development board which contains a 100-pin PIC32MZ2048EFM100 chip, a LAN8720 Ethernet connection, a mikroBUS board with a WINC1510 WiFi chip (plus other connectors, LEDs and switches). I have been able to execute all of the examples in my b**k to understand if there were any significant differences between the Curiosity development kit and the previous PIC32MZ Starter Kit. Except for the changed pin locations between the 144-pin and 100-pin parts, I had no problems.
 
Next, I wanted to add the wifi feature of the board to an existing application. This is where I started stumbling. First (naively) I went to the Harmony "Help" files to understand how the WIN1500 chip works. There are about 50 pages of repetitive blather. I then went to the WINC1500 datasheet (~125 pages) which explained how the chip works. I noticed that most of the Harmony help is just copied and pasted from the datasheet. Of course, the datasheet tells nothing about how to use the WINC1500 in the Harmony environment.
 
Next, I went to the demos (in v2.06). All of the wifi demos are essentially the same demo. The demo requires FreeRTOS and has numerous options, but each one can only be run one at a time by reconfiguring and recompiling the basic demo.
 
The WINC1500 documentation describes 2 modes -- a native mode and a host mode. The native mode uses the on-board TCP/IP stack to do basic TCP v4 and TLS1.2 functions (essentially Berkeley sockets). The host mode bypasses the on-board TCP/IP firmware and sends everything to the host (i.e. Harmony stack).
 
I also reviewed the Harmony and wireless embedded forums for any relevant information. At this point I had to revert to source code inspections and file compares to try to unravel what the demos were doing in the Harmony environment.
 
So far, here is a list of things that are missing from the Harmony implementation (documentation and demos) and IMHO need to be added:
 
  • how to use the pin manager to configure the WINC1500 (note: the MHC bsp package for the Curiosity dev board has no information on the pin definitions).
  • how to use the WINC1500 chip in the Harmony superloop -- the demos only show a FreeRTOS design. IMHO, this belongs in the Third-party Library tab, not in the drivers.
  • how to use the WINC1500 in native mode
  • how to use the WINC1500 in host mode
  • how to implement both an Ethernet (wired) and a wifi (wireless) TCP/IP interface
So, here are my questions for the forum:
  1. Has anyone out there implemented the WINC1500 drivers and an application using the Harmony superloop only? If not, I will try to unravel this ball of string.
  2. If I am successful, does anyone even care? :)
 
#1
jyaron
Super Member
  • Total Posts : 392
  • Reward points : 0
  • Joined: 2003/11/07 12:43:15
  • Status: offline
Re: Harmony and ATWINC1500 2018/08/15 14:34:02 (permalink)
0
Thanks for the review. I've used the older stack under MLA with wired NIC only. I liked it... you could simply uncomment the features you wanted in the config .h and they would all run simultaneously. Seems like the newly mandated Harmony requirement sounds robust, but how to config it needs to be absorbed via osmosis or something. PIC32 is the only processor selection and 16-bit dsPIC's have been orphaned. Also, sounds like Harmony is still a house of cards.
 
Since I have an official deadline to implement a WINC1500 system using minimal features, I opt'ed to go the OS-less MLA route in native mode. I'd like to eventually use other features of the original stack (since the native stack is light), but too risky for me at this point. Any findings you post will definitely interest me. Thanks.
post edited by jyaron - 2018/08/15 14:41:50
#2
friesen
Super Member
  • Total Posts : 2082
  • Reward points : 0
  • Joined: 2008/05/08 05:23:35
  • Location: Indiana, USA
  • Status: offline
Re: Harmony and ATWINC1500 2018/08/15 15:19:55 (permalink)
0
There is basically no point in using the WINC1500 in dumb mode with a PIC32MZ.  What is to be gained? (I'm not sure what you mean by native vs host)
 
My guess is that the core reason that Harmony is not doing a superloop is probably because they have only converted the asf framework to harmony, and haven't really written new code. 
 
I personally see converting the driver to a superloop as a challenge, as you'll have to rewrite Harmony/ASF to support it. A starting to point look would be to find all the xTaskCreates and convert those to superloops or ISR's, while making sure each loop doesn't block the other.
 
 
Things I have learned along the way..
1. The WILC1000 and WINC1500 both work with the 1000 driver, the 1500 accepts the same firmware binary as the 100.
2. The harmony drivers are basically copied from the ASF framework.
3. There are some slight differences between the ASF and Microchip implementations, so pay attention to the fixes listed in the Amazon FreeRTOS branch.
4. The Atmel ASF WILC and WINC doc's are much better than Harmony's, and most items are applicable.
 

Erik Friesen
#3
jandle
New Member
  • Total Posts : 22
  • Reward points : 0
  • Joined: 2017/05/27 06:57:30
  • Location: 0
  • Status: offline
Re: Harmony and ATWINC1500 2018/08/17 05:00:07 (permalink)
0
I prefer the RTOS solution; however, there are places that 2.05 hung or crashed that I could not identify.  I am interested in a solution.  I'd prefer to use Berkeley as that is the level of my Linux TCP programming, but 'there is always more to learn'. 
 
I have an idled project that I need to get back to later this year but no bandwidth to help solve issues before then.
#4
friesen
Super Member
  • Total Posts : 2082
  • Reward points : 0
  • Joined: 2008/05/08 05:23:35
  • Location: Indiana, USA
  • Status: offline
Re: Harmony and ATWINC1500 2018/08/17 05:21:11 (permalink)
0
I used freertos tcp, I think it is a good solution, so far it works flawlessly.

Erik Friesen
#5
malaugh
Super Member
  • Total Posts : 400
  • Reward points : 0
  • Joined: 2011/03/31 14:04:42
  • Location: San Diego
  • Status: online
Re: Harmony and ATWINC1500 2018/08/27 07:44:39 (permalink)
0
You can use the WINC1500 without an RTOS and uae the WINC in "smart" mode (using the built in stack) if you use the Atmel studio examples, and use the Atmel WINC libraries. You do need to abandon Harmony and write your own SPI driver using the instructions provided by Atmel.
#6
BillP
Super Member
  • Total Posts : 337
  • Reward points : 0
  • Joined: 2014/09/28 07:53:35
  • Location: CA
  • Status: offline
Re: Harmony and ATWINC1500 2018/08/27 10:52:01 (permalink)
0
malaugh - I agree that your path would be easier, but the point of this post was to try to figure out how to implement the WINC1500 device using the superloop in Harmony. 
 
So far, I have concluded that the wifi demos are hacked versions of the Atmel demos and duct-taped into Harmony.  I did find that one of the demos (the wifi_rgb_easy_configuration) is designed for the Curiosity PICMZ EF board.  I ran that demo and it worked!  Then I discovered that the Curiosity MZ EF board also has an MRF24WN wifi device which is used in the demo. 
 
I then changed direction and am looking at converting the rgb wifi demo to the superloop to understand how that demo works and how it can work in parallel with a wired connection (i.e. 2 interfaces).  Once that works, I will attack the WINC1500 device, since it appears that driver was built based on the older MRF24W device. 
 
This will take some time because there is a lot of "spaghetti code" to unravel (with no documentation of what it is doing).  Stay tuned. 
#7
DougD
Junior Member
  • Total Posts : 97
  • Reward points : 0
  • Joined: 2012/12/24 10:12:06
  • Location: 0
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/05 09:55:58 (permalink)
0
BillP
So, here are my questions for the forum:
  1. Has anyone out there implemented the WINC1500 drivers and an application using the Harmony superloop only? If not, I will try to unravel this ball of string.
  2. If I am successful, does anyone even care? :)



Bill,
 
Yes, I care!  But I care about using the WINC1500 in native mode, not about using it with Harmony in hosted mode.  My application is not conducive to sharing MCU resources with Harmony.  Unfortunately, I'm using a PIC32MZ, which isn't supported by the MLAs--only by Harmony.
 
I got so frustrated with this that I actually jumped ship last month to a Silicon Lab's module.  Unfortunately, after wasting three weeks learning their WGM110 starter kit and module, and studying hundreds of pages of documentation, I am finally giving up on them.  Their technical documentation is terribly lacking, and many of their (European?) technical support staff have difficulty with English, and don't seem to really understand their own product.  So, here I am back with Microchip, with their superior documentation, trying to learn how to integrate the WINC1500 with a PIC32MZ, without using Harmony.
 
Regards,
Doug D.
 
#8
friesen
Super Member
  • Total Posts : 2082
  • Reward points : 0
  • Joined: 2008/05/08 05:23:35
  • Location: Indiana, USA
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/05 10:04:13 (permalink) ☄ Helpfulby mikewake 2019/10/04 08:15:49
5 (1)
I'd suggest using the ASF driver and freertos+tcp.  You can operate this in WILC1000 mode.
 
There are lots of advantages to this method, in my opinion.
 
I am using this method of operation with a MZ DA.  Let me know if you would like some code to jump start this.  

Erik Friesen
#9
DougD
Junior Member
  • Total Posts : 97
  • Reward points : 0
  • Joined: 2012/12/24 10:12:06
  • Location: 0
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/05 12:40:57 (permalink)
0
Erik,

Thanks for your reply and offer.  I'm not familiar with the ASF driver.  The link at http://www.microchip.com/...ced-software-framework suggests that it is for SAM microcontrollers and the Atmel Studio IDE?

I wanted to run the WINC1500 in native mode, using the TCP/IP stack and RTOS that are already loaded on in it firmware.  I didn't want to have to load the TCP stack and RTOS on the PIC32MZ EF, in addition to my time-sensitive application.
 
From what others have been telling me in the Embedded Wireless forum, it sounds like this might be a relatively straight-forward porting of the SPI, interrupt, and timer from the MLA library.

Doug D.


#10
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11391
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/05 13:06:33 (permalink)
0
The ASF driver is what the MLA demos use.  It's included in the MLA, you don't need to download anything else.  Just port the MLA example as-is.
#11
DougD
Junior Member
  • Total Posts : 97
  • Reward points : 0
  • Joined: 2012/12/24 10:12:06
  • Location: 0
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/07 16:41:59 (permalink)
0
Erik,

I installed the MLA and saw the ASF WINC1500 driver files you were referring to, and have been going through the Atmel and Microchip driver documentation.  I'm ordering a WINC1500 PICtail daughter board so I can learn how to program the various networking functions, although probably just with a PIC24F PIM on an Explorer 16 board to start, not a PIC32MZ.

I've read other posts on the forum where people recommended disabling the PIC32MZ's cache and using "coherent" attributes (whatever that means), but I don't know if that was because they were hosting the TCP/IP stack, or if the PIC32MZ cache can also cause problems when using the ASF driver.  Did you have any problems with this?

You suggested using the ASF driver, freertos+tcp, and WILC1000 mode.  I'm sold on using the ASF driver, but I've never used an RTOS (or even TCP) before.  My application will see flurries of fast input captures, and I'm concerned that RTOS interrupts might interfere with processing them.  Could you please explain a little about freertos+tcp and WILC1000 mode, and why you recommend them?

Could I also take you up on your code offer?

Thanks,
Doug


#12
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11391
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/07 18:01:21 (permalink)
0
with a PIC24F PIM on an Explorer 16 board to start

 
That's a good starting point.  Get the 24F128GA310 PIM and you can run the demo code out of the box.
#13
friesen
Super Member
  • Total Posts : 2082
  • Reward points : 0
  • Joined: 2008/05/08 05:23:35
  • Location: Indiana, USA
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/07 18:54:28 (permalink)
0
Winc1500 mode is more limited, and you have to have mechanisms in place to update the firmware, vs having it all in the mz firmware. As for asf, I really am referring to the asf framework 3.43, it has newer drivers than harmony. It also appears that the harmony driver turns off the wilc interrupt and only polls, which isn't ideal for throughput. I'll get some code around, mainly the networkinterface and spi porting is what you need. I borrowed heavily from the Amazon freertos mz demo. They have a couple of small but important changes that make the stack work correctly on the mz.

Erik Friesen
#14
DougD
Junior Member
  • Total Posts : 97
  • Reward points : 0
  • Joined: 2012/12/24 10:12:06
  • Location: 0
  • Status: offline
Re: Harmony and ATWINC1500 2018/10/08 10:58:59 (permalink)
0
I'll do that.  I think I've been making this harder than it needs to be.  Thanks very much.
#15
Jump to:
© 2019 APG vNext Commercial Version 4.5