• AVR Freaks

AnsweredHot!ATWINC1500 For (Extreme) Beginner

Page: 12 > Showing page 1 of 2
Author
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
2020/06/30 16:59:50 (permalink)
0

ATWINC1500 For (Extreme) Beginner

Hello,
I am interested in trying to interface one of these to a PIC18F45K50 via SPI.  No other reason besides I already have one on a breadboard and talking over USB.  I have zero experience with network programming with Microchip based devices.  I am reading through the operating manual and have some very vague questions.  To start, my understanding of SPI in this respect is I simply read and feed file data stream.  I am not understanding how to configure the 1500 to communicate.  Is there some kind of library for PIC processors to interface and perform configuration over SPI?  Or is there an application that allows direct connection to the 1500 to configure?  I see tons of "canned" applications for these as extension boards for say SAM D21 but kind of want to approach from I have a PIC in one hand and a breakout board in the other and want to make them chat.   Connect PIC to 1500.  Connect to WAP.  Use PuTTy to echo something over a TCP port.  Is that doable out of the box or is there a ton of app overhead in the background that I am not seeing?  Normally I am accustomed to direct read and write from respective config registers for generic SPI/I2C stuff but a majority of personality assignment seems to be software based with these.
 
Understand quite vague.  Take it easy on me...super basic starting points please!
#1
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/06/30 18:21:42 (permalink)
0
There is a ton of overhead in the background you're not seeing, though there is supposedly an unsupported AT command firmware for it, but I've never used.
 
Download the latest MLA; it has demo applications.
#2
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 14:46:34 (permalink)
0
Following up, I downloaded this and am trying to compile associated libraries for example winc1500_pic18f87k22_ex8.  I unfortunately can't get that far out of the box as error log is pointing out issues that seem to stem from syntax in INTERRUPT_MANAGER_H.  In any case, I am noticing that the includes expect a WINC1500 device type of pictail or click board extension to be defined.  Not a big deal as I can reference relevant pins to project.  But I am having a difficult time conceptually with this when it comes to embedding into existing application.  Is there an easier way to do this than going and porting all this over manually?  I have a variety of timing parameters and config registers set up for USB operation, I2C, and ADC.  Ideally this would kind of fold around what I have already developed so far.  A lot of what I am seeing for this is kind of "buy this demo board and this extension board...use this library and you should be fine."  I am trying to custom configure by using MCC however I don't see any option for ATWINC1500.  There's a bit of stuff for Mikro Elektronika Click boards in MCC but nothing else that I can discern.  Can you point me in the right direction importing just the MC WINC1500?  Or is that not currently an option and I should build around one of the MikroE boards in support?
#3
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 15:21:41 (permalink) ☼ Best Answerby IBrokeIt 2020/07/01 18:05:06
5 (1)
I just loaded winc1500_pic18f87k22_ex8 from mla-v2018_11_26 in MPLAB 5.35 with XC8 1.38, and it built successfully.  It did not build with XC8 1.43 or 2.X.
#4
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 15:24:27 (permalink)
0
jtemples
It did not build with XC8 1.43

Interesting.
What failed with 1.43?
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#5
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 15:26:00 (permalink)
0
Never thought to try going backwards.  I am running 2.05 so I guess that is the issue then.  
 
In any case, still wondering if MC provides any libraries via MCC for this or if that is kind of a dead end at moment in time.
#6
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 15:29:04 (permalink)
0
IBrokeIt
Never thought to try going backwards.  I am running 2.05 so I guess that is the issue then.  

Indeed. XC8 v2.xx is a very different beast to 1.xx.
C90 mode was included in 2.xx to make it almost the same.
That's why I'm curious that John reported 1.43 also failed.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#7
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 15:30:57 (permalink)
5 (1)
ric
Interesting.
What failed with 1.43?


Microchip MPLAB XC8 C Compiler (PRO Mode) V1.43
Build date: Jul 24 2017
Part Support Version: 1.43
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

mcc_generated_files/interrupt_manager.c:75: error: (1098) conflicting declarations for variable "_m2m_EintHandler" (../../../../framework/driver/wifi/winc1500/src/wf_hif.c:71)
(908) exit status = 1
make[2]: Leaving directory '/home/john/proj/mla-v2018_11_26/apps/tcpip/wifi_winc1500_demo/winc1500_pic18f87k22_ex8.X'
make[1]: Leaving directory '/home/john/proj/mla-v2018_11_26/apps/tcpip/wifi_winc1500_demo/winc1500_pic18f87k22_ex8.X'
make[2]: *** [nbproject/Makefile-exp8_p18f87k22_winc1500.mk:1061: dist/exp8_p18f87k22_winc1500/production/winc1500_pic18f87k22_ex8.X.production.hex] Error 1
make[1]: *** [nbproject/Makefile-exp8_p18f87k22_winc1500.mk:91: .build-conf] Error 2
make: *** [nbproject/Makefile-impl.mk:39: .build-impl] Error 2

BUILD FAILED (exit value 2, total time: 3s)



#8
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 15:42:56 (permalink)
5 (1)
still wondering if MC provides any libraries via MCC

 
I don't use MCC so I have no idea.  I just used the the MLA files as a library.
#9
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 16:50:34 (permalink)
0
After looking around I do not see the option to download XC8 1.38.  Seems to be phased out.  Even if I did I am unsure if it would run in parallel with or fight 2.05.  Since this is the most recent version of MLA out there, support effectively ends at 1.38, and I do not see a way to import code to device from MCC or other libraries I think the answer is this is kind of a no go.  So I guess I will spin the question in a different direction and see if anything else pops up in the next few days then close.
Does anyone have an example of a MC WiFi device they have integrated with PIC18F45K50 (or really anything in the 18 series) within the last year or so or a recommendation on what to use?
#10
ric
Super Member
  • Total Posts : 28009
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 17:02:43 (permalink) ☄ Helpfulby IBrokeIt 2020/07/01 18:05:17
4 (1)
IBrokeIt
After looking around I do not see the option to download XC8 1.38. 

You can get all the old versions at:
https://www.microchip.com...spic-downloads-archive
 

Even if I did I am unsure if it would run in parallel with or fight 2.05. 

MPLABX fully supports having multiple versions installed.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#11
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 17:29:15 (permalink)
0
Should have kept scrolling down the page.  Found it and installed 1.38.  Still complaining about this config file which is present in the source file tree.  Similar to compilation errors with 2.05.  Not exactly the same but still complaining about these register values.  Idk.
 
mcc_generated_files/mcc.c:49: error: (1363) unknown configuration setting/register (RETEN = ON) used
mcc_generated_files/mcc.c:50: error: (1363) unknown configuration setting/register (INTOSCSEL = HIGH) used
mcc_generated_files/mcc.c:51: error: (1363) unknown configuration setting/register (SOSCSEL = DIG) used
mcc_generated_files/mcc.c:55: error: (1363) unknown configuration setting/register (FOSC = HS1) used
mcc_generated_files/mcc.c:56: error: (1363) unknown configuration setting/register (PLLCFG = ON) used
mcc_generated_files/mcc.c:61: error: (1363) unknown configuration setting/register (PWRTEN = OFF) used
mcc_generated_files/mcc.c:64: error: (1363) unknown configuration setting/register (BORPWR = ZPBORMV) used
mcc_generated_files/mcc.c:71: error: (1363) unknown configuration setting/register (RTCOSC = 0) used
mcc_generated_files/mcc.c:72: error: (1363) unknown configuration setting/register (EASHFT = ON) used
mcc_generated_files/mcc.c:73: error: (1363) unknown configuration setting/register (ABW = MM) used
mcc_generated_files/mcc.c:74: error: (1363) unknown configuration setting/register (BW = 16) used
mcc_generated_files/mcc.c:75: error: (1363) unknown configuration setting/register (WAIT = OFF) used
mcc_generated_files/mcc.c:78: error: (1363) unknown configuration setting/register (CCP2MX = PORTC) used
mcc_generated_files/mcc.c:79: error: (1363) unknown configuration setting/register (ECCPMX = PORTE) used
mcc_generated_files/mcc.c:80: error: (1363) unknown configuration setting/register (MSSPMSK = MSK7) used
mcc_generated_files/mcc.c:85: error: (1363) unknown configuration setting/register (BBSIZ = BB2K) used
mcc_generated_files/mcc.c:93: error: (1363) unknown configuration setting/register (CP4 = OFF) used
mcc_generated_files/mcc.c:94: error: (1363) unknown configuration setting/register (CP5 = OFF) used
mcc_generated_files/mcc.c:95: error: (1363) unknown configuration setting/register (CP6 = OFF) used
mcc_generated_files/mcc.c:96: error: (1363) unknown configuration setting/register (CP7 = OFF) used
mcc_generated_files/mcc.c:107: advisory: (1) too many errors (21)
#12
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 18:04:40 (permalink)
0
Shoot.  Somehow the previous PIC model that I was using was populated in the project config so that's why the registers weren't there.  I was able to duplicate exactly what John presented.  The error now is invariant between that and 2.05.  It however does compile with 1.38.  Now going through this config information and trying to cross reference to relevant parameters in the 18FK50 and what will/won't break stuff makes me want to cry so I'm going to have to settle on compilation experiment.
 
#13
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 19:06:09 (permalink)
2 (1)
I am unsure if it would run in parallel with or fight 2.05.

 
As ric said, you don't need to worry about that.  I've got at least 20 XC8 and Hi-Tech compilers installed. 
 
I'll try to figure out what the build error is over the long weekend.
#14
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 19:14:57 (permalink)
0
I was able to ultimately compile this so thank you.  No need unless you are curious yourself on solving it.
 
My issue now is trying to wrap my head around how I have a fighting chance at porting this over to my 18F45K50 without weeks of digging and mapping configurations.  After looking at this for a half a day I'm kind of like yeah...is it worth it trying to do this just to probably end up failing.  As much as I want to take a stab at it I am kind of beginning to understand now why there are a few main modes of development boards (and especially programming) for this and I am not seeing a lot of custom (tinkering) integration.  Maybe this is easier than I am making it in my mind but looking at this I get a general sense of weeks of involvement.
#15
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 20:52:28 (permalink)
0
The errors are from the configuration registers.  Those are easy to change since there's a UI in MPLAB to do it.  Even if you don't initially understand them, you'll be able to get the code to compile at least.
 
But you need to select a different PIC.  Your 45K50 only has 16KB of program memory.  The code size is about 24K in PRO mode.
post edited by jtemples - 2020/07/01 22:22:38
#16
IBrokeIt
Starting Member
  • Total Posts : 64
  • Reward points : 0
  • Joined: 2019/08/13 12:07:00
  • Location: 0
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 21:07:07 (permalink)
0
Showing this version has 32K prog memory.  But I agree with your point for multiple reasons.  I am violating this thing to the fullest trying to perform some complex math (for an 8 bit platform) which results in extreme program space overhead.  I can go from 30% utilization with base USB includes to 80% by trying to perform some moderate floating point math.  Add TCP/IP stack to that and game over.  Been contemplating moving over to 32 bit platform sporting barrel shifters and all.  It looks like there are some comparatively really powerful options still available in clunky DIP for breadboard prototyping stuff with same peripheral sets.  I see this also opens up the ability to use Harmony which I think there are a lot more elegant WiFi and USB OTG options for.  I never really considered that point in that by the time I get this functioning I am dead in the water from a program and data memory space anyway.  PIC18 has its place but probably not in what I am trying to accomplish.  Thanks for saving me some headache there..honestly never crossed my mind but would have in due time after a big fail!
#17
jtemples
عُضْوٌ جَدِيد
  • Total Posts : 11936
  • Reward points : 0
  • Joined: 2004/02/13 12:31:19
  • Location: Southern California
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/01 22:26:48 (permalink)
4 (1)
The MLA code will also run on a PIC24.  That gives you a lot more speed and memory size options, without getting into all the Harmony stuff.
#18
KJSmeets
New Member
  • Total Posts : 15
  • Reward points : 0
  • Joined: 2010/09/05 12:18:19
  • Location: the Netherlands
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/04 10:17:22 (permalink)
0
Hi there, IBrokeIt -
 
have you been able to make progress?
I was at the same stage as you two days ago - the code now compiles fine for my pic24fj64ga102.
 
Only thing is when I try to run the TCP client app, I get stuck in the
 
WaitForDataByte();

 
in the m2mStub_SpiTxRx function in wf_mcu_driver_stub.c
 
The WaitForDataByte() is a macro checking below two flags:
 
#define WaitForDataByte() while ((SPI2STATbits.SPITBF == 1) || (SPI2STATbits.SPIRBF == 0))

 
It is the SPI2STATbits.SPIRBF which remains 0 - I am not sure I understand why that is?....
 
Any thoughts? There is nothing in the errata to suggest a next area to look.
 
 

www.fotoloog.org - My hobbyist blog
#19
KJSmeets
New Member
  • Total Posts : 15
  • Reward points : 0
  • Joined: 2010/09/05 12:18:19
  • Location: the Netherlands
  • Status: offline
Re: ATWINC1500 For (Extreme) Beginner 2020/07/04 12:01:21 (permalink)
0
OK, found it - turns out that the SPI module shall be in 'legacy' mode, not in 'enhanced buffer mode'.
(at least when using the MLA)
 
Clearing SPIBEN bit did the trick!
 
next stop: trying to figure out why it is hanging on below:
 

 WINC1500 Host Driver:
 Chip ID:                     3a0
 Firmware Version:            19.4.4
 Firmware Build Date/Time:    Nov 19 2015, 22:36:45
 Firmware Min Driver Version: 19.3.0
 Host Driver Version:         19.3.0
  Host Driver Build Date/Time: Jul  4 2020, 20:56:09
=========
                                                                     
TCP Client Demo
ssid: fotoloog-L
port: 80
=========
                                                                     
Starting ...
                                                                  


www.fotoloog.org - My hobbyist blog
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5