Olimex Support Forum

Microcontrollers => PIC => Topic started by: APL on January 16, 2018, 05:37:47 PM

Title: PIC MAXI WEB - Revision A board
Post by: APL on January 16, 2018, 05:37:47 PM
Is this board capable of 100Mb/s ethernet?
I've got it on line and can talk to it fine. But my switch is indicating that it a 10Mb/s connection.

Secondly, is there a list somewhere of the significant changes between a Rev A board and Rev C Maxi Web?
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 17, 2018, 08:56:18 AM
Yes, PIC-MAXI-WEB is capable of 100Mb/s Ethernet. A lot of things might be forcing it to 10Mb/s. Did you test with our demo: https://www.olimex.com/Products/PIC/Development/PIC-MAXI-WEB/resources/PIC-MAXI-WEB_5_42.zip ? Check the macros in folder _PATH_\PIC-MAXI-WEB 5.42\TCPIP\Demo App\Configs - especially take a look at "#define TCP_CONFIGURATION" in "TCPIP OLIMEX_PIC-MAXI-WEB.h".

The latest hardware revision of PIC-MAXI-WEB is revision B. There is no revision C. The changes between revision A and revision B are only in the white print (added prints and logos such as PB-free, Recycle bin, RoHS Compliant, etc).
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 18, 2018, 01:03:48 AM
"The changes between revision A and revision B are only in the white print (added prints and logos such as PB-free, "

My LCD display is indicating TCPStack v4.02. As there is no hardware difference, I could update to the latest IP stack?

I was able to get to the web page at the IP address displayed on the LCD, displayed in my browser too.

I then tried to update the web page via ftp, but now all I get is "Not found" in the top left of the screen.

So, a couple of question.

1. Can I update to a more recent ip stack through the ftp - I guess not?

2 What do I need to do to get a web page served with access to the two relays and two switches and leds?

Clearly, I've done something wrong. What can I do to fix it?  Thanks.
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 18, 2018, 08:28:26 AM
Yes, you can update to the latest demo that we have provided here: https://www.olimex.com/Products/PIC/Development/PIC-MAXI-WEB/resources/PIC-MAXI-WEB_5_42.zip - of course, you can also use the latest stack released by Microchip, but it would require adapting it to fit the hardware (yet, you have a starting point and configurations from the 5.42 project).

The demo code that we use for testing is old indeed that is why the display says 4.02. The demo we provide at the web-page is newer. Testing code has a lot of things that the end customer would not need (routines to test each pin via external headers; routines to check each peripheral; etc). So that is why we also provide customer-friendly demo that I linked above.

1. Can I update to a more recent ip stack through the ftp - I guess not?

You can update the stack but not via ftp. You need a PIC-compatible programmer to change the software of PIC-MAXI-WEB.

2 What do I need to do to get a web page served with access to the two relays and two switches and leds?

A PIC18 programmer (like Olimex PIC-KIT3 or any programmer that would fit the ICSP connector); MPLAB 8.x or MPLABX; the free version of PIC18 C Compiler 3.40; and time to read the documentation and understand the code.

Best regards,
Lub/OLIMEX
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 18, 2018, 12:31:00 PM
"that we have provided here: https://www.olimex.com/Products/PIC/Development/PIC-MAXI-WEB/resources/PIC-MAXI-WEB_5_42.zip"

Thank you, I've downloaded it.

"You need a PIC-compatible programmer to change the software of PIC-MAXI-WEB."

At the same time I bought the PIC Maxi Web, I also bought an ICD2 which I notice has now been discontinued.

I never had much luck using it ( entirely through my own ignorance ) but I have it here, will that do as a device to program the Maxi-Web?

"MPLAB 8.x or MPLABX;"

I've just managed to download MPLABX but it's a steep learning curve :)

"and time to read the documentation and understand the code."

I'd like to upgrade to the 5.42 software, I see there is quite a few additional features included in this revision. But all I want to do at this stage is customise the web page for my own project.

Thanks for you help.








Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 18, 2018, 02:39:17 PM
ICD2 is fine!!! It is compatible with PIC-MAXI-WEB! Notice however that ICD2 debugger is not supported by Microchip in MPLABX as far as I am aware. So use MPLAB 8.92 instead. Download it from here: http://www.microchip.com/development-tools/downloads-archive (find in the page the download link for "MPLAB IDE v8.92").

Then you also need compiler we used for the project else you would have compiling errors. It might be hard to find exactly MPLAB C Compiler v3.40; so try with MPLAB C for PIC18 v3.47 in LITE mode (the LITE mode is free and completely sufficient). It can be downloaded from here: http://ww1.microchip.com/downloads/en/DeviceDoc/mplabc18-v3.47-windows-lite-installer.exe

Once you install MPLAB 8.92 and once you install the compiler, open the project and ensure that the paths of the project are set properly so the project is compiled with MPLAB C for PIC18 v3.47. Compile the project. Select the ICD2 debugger and the chip from the menus. Download the compiled binary to the board.

It is described in the text document inside the demo project that you previously downloaded how to manipulate the web page.

Best regards,
Lub/OLIMEX

 
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 18, 2018, 05:48:27 PM
Thanks for your reply.

I've got the MPLABv8.92 but it won't recognise my ICD2, I'm getting the following error.

"Connectiong to MPLAB ICD2,
ICD0019 Communications Failed to open port (USB) (Windows: GetLast Error() =0x0. 'The operation completed successfully')
ICD0021 Unable to connect with MPLAB ICD2 (USB)
MPLAB ICD 2 ready for next operation."

Looking at Windows device manager, it seems to be missing a driver, and doesn't seem to thing the MPLAB ICD2 device driver is valid, if I try to manually install the driver.

Driver is now installed but still same problem.

Oh! ICD2 is powered from USB and has green light on when connected to USB.
And Windows 10

I've googled the error and loads of people seem to have had the problem. Just wondering if you know a fix?

Thanks
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 19, 2018, 11:13:08 AM
Maybe Windows appointed improper drivers to the ICD2 unit. Try to manually switch between available drivers until you find the proper ones. It is usually done the following way:

It is a good idea to first disable the driver signature enforcement that is enabled in Windows 10 by default (since it is not clear if ICD2 drivers are signed). There are lot of guides online on how to disable it under Windows 10. So disable the driver signature enforcement and then follow the driver switching details below.

1. Open “Windows Device Manager”
2. Identify the entry of the ICD2 unit right-click over it – maybe the entry is “Microchip Win USB device” or similar
3. Select “Update Driver Software...”
4. Select “Browse my computer for driver software”
5. Select the bottom option “Let me pick from a list of drivers on my computer”
6. Select the first item in the list. If you already tried the first, then select the second, etc.
7. Select next and close the window.
8. Test again in MPLAB, if the problem persists repeat for each entry in the list mentioned in point 6.

Overall, there might be more information in the Microchip's forums on how to get ICD2 working under Windows 10.
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 22, 2018, 03:28:11 PM
I've had no luck with Windows10 the Olimex ICD2 and MPLab, which is extremely frustrating.

So, I've just tried to get access to the Maxi Web via the serial port.


I've been reading the 'howto' by Tom Nguyen and it suggests I should try 19200 baud 8 data and 1 stop bit. Apparently the procedure to start serial interaction with the board is to press and hold button 1, power down the board, power back up and then release button 1.

Question 1: Will a board reset with the rst button near the ethernet connector do instead of a full power down.

Question 2: I'm not getting any indication of activity on minicom, no illegal characters ( indicative of incorrect baud or data settings ) so, is there a character sequence that the board expects in order for it to recognise interaction across the serial port?

( does it require any specific signals to be present on the 9 pin D-Type? (DCD, RTS, CTS ) Etc?
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 22, 2018, 04:43:35 PM
Quote
Question 1: Will a board reset with the rst button near the ethernet connector do instead of a full power down.

Yes. Also when you enter the serial mode, the IP of the board would not be printed on the display (it would stay 0.0.0.0). And the LED LD0 would not blink.

Quote
Question 2: I'm not getting any indication of activity on minicom, no illegal characters ( indicative of incorrect baud or data settings ) so, is there a character sequence that the board expects in order for it to recognize interaction across the serial port?

( does it require any specific signals to be present on the 9 pin D-Type? (DCD, RTS, CTS ) Etc?

No. If you look at the datasheet or the schematic you would notice that only RX, TX and GND are connected and required. What kind of COM port cable are you using? Are you connecting cable's RX to board's TX and vice versa? Are you careful about the COM port levels - this is meant for PC COM port and the voltage levels are 5.5V (not 3.3V as Arduino)??? Is your cable compatible?
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 22, 2018, 05:45:39 PM
Yes. Also when you enter the serial mode, the IP of the board would not be printed on the display (it would stay 0.0.0.0). And the LED LD0 would not blink.

OK, LED LD0 isn't blinking. But I'm seeing 192.168.0.1 on the display - but under normal reset it picks up the IP address from my router. So something different seems to be happening.

Is your cable compatible?

Yea, that's a good question. I've used it for other equipment. I guess it depends how the Olimex presents itself, DTE or DCE, maybe I need a Cross cable. I'll check that out.
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 23, 2018, 12:46:26 AM
I needed a crossover cable. Now I can get the serial port menu.

Do I need any particular protocol to upload the web page?

Thanks
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 23, 2018, 10:30:18 AM
Good progress. The page can be uploaded over the Ethernet, as described in Tom's guide: https://www.olimex.com/Products/PIC/Development/PIC-MAXI-WEB/resources/PIC-MAXI-WEB_tom_nguyen.pdf starting at the bottom of page 2:

Quote
"Next you will need to load the image file for the webpage. Connect a LAN cable, wait a bit and check the IP address displayed on the LCD. Open your favorite browser and enter the following (for example the IP is 192.168.0.224):
http://192.168.0.224/mpfsupload"
Title: Re: PIC MAXI WEB - Revision A board
Post by: Stanimir5F on January 23, 2018, 01:02:47 PM
Hello APL!

You don't need RS cable to upload the page. In fact the easiest way to update the web page is through the browser. In order to do so - go to the ip address printed on the LCD and append "/mpfsupload" after the ip address and then choose the bin file you wish to upload.
Keep in mind the different versions of the stack have different bin files for the webpage. Otherwise the result will be a messy page without any decent design.
If you want to change something small on the page (like text or colors) you have to do the changes on the sources OF THE WEBPAGE (not on the project). These files are located in "PIC-MAXI-WEB 5.42\TCPIP\Demo App\WebPages2". After you do that you have to "compile" a bin file using the MPFS2 tool which is included inside the stack. You can find it inside: "PIC-MAXI-WEB 5.42\Microchip\TCPIP Stack\Utilities\MPFS2.jar". There you select the source folder and the outbut file: *.bin.
If you want to make changes in the functionality (like adding additional button/LED or just another variable) then you have to make changes on the project as well, recompile it and reprogram the board.

Stan, Olimex
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 23, 2018, 03:22:11 PM
In fact the easiest way to update the web page is through the browser. In order to do so - go to the ip address printed on the LCD and append "/mpfsupload" after the ip address and then choose the bin file you wish to upload.

Hi Stan,

I've seen that procedure documented, but it's never seemed to work for me. I've got the 4.02 stack on board - does that make any difference?


Keep in mind the different versions of the stack have different bin files for the webpage. Otherwise the result will be a messy page without any decent design.

So, can I download the 4.02 build ( since I can't yet upgrade to the 5.42 stack, without functioning MPLab )


These files are located in "PIC-MAXI-WEB 5.42\TCPIP\Demo App\WebPages2". After you do that you have to "compile" a bin file using the MPFS2 tool which is included inside the stack. You can find it inside: "PIC-MAXI-WEB 5.42\Microchip\TCPIP Stack\Utilities\MPFS2.jar". There you select the source folder and the outbut file: *.bin.

Will the MPFS2 tool work for the 4.02 stack?

If you want to make changes in the functionality (like adding additional button/LED or just another variable) then you have to make changes on the project as well, recompile it and reprogram the board.

Right now I'd be happy to use the default web page with access to the relays.

Thanks, both for your help.
Title: Re: PIC MAXI WEB - Revision A board
Post by: Stanimir5F on January 23, 2018, 04:49:56 PM
Hello APL!

1) Do you see any kind of webpage? Something like this (https://imgur.com/5Vo6UCd).

2) I'm not very familiar with 4.02v of the Microchip stack because it has been released more than 10 years ago and I have worked mostly with 5.00 and newer. But from what I can see from the sources this version doesn't support dynamic update of the webpage and the only way to change it (webpage) is through the sources. But this includes reprogramming which is the bigger problem.

3) MPFS2 tool is just a generator of either *.bin or *.c or another type of output file to content the page, so yes, it is included in the stack 4.02

Stan, Olimex
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 23, 2018, 05:55:11 PM
I managed to get ICD2 working with Windows 10 and MPLAB 8. Have to test a bit more and take screenshots and will give you instructions tomorrow. So you can don't have to worry about 4.02 but upload the latest demo.
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 23, 2018, 06:01:38 PM
Hello APL!

1) Do you see any kind of webpage? Something like this (https://imgur.com/5Vo6UCd).


Hi

It used to serve a webpage ( not at all like your example ) but I tried to upload a new file via ftp, now all I get is 'Not found' in the top left hand corner of the browser.


2) I'm not very familiar with 4.02v of the Microchip stack because it has been released more than 10 years ago and I have worked mostly with 5.00 and newer. But from what I can see from the sources this version doesn't support dynamic update of the webpage and the only way to change it (webpage) is through the sources. But this includes reprogramming which is the bigger problem.

Do you have a zip archive of the 4.02 version? I understand the web page is dependent on some functions provided by the underlying stack, so while I have the 5.1 archive, I think there may be incompatibilities with the web page supplied in that version and the 4.02 I've got running on the board?

3) MPFS2 tool is just a generator of either *.bin or *.c or another type of output file to content the page, so yes, it is included in the stack 4.02

Got it, and I've attempted to use it to build a page. I've got a basic web page in a subfolder and I point MPFS2 at the folder and it generates two files: "MPFS2SettingDetails.xml" & "MPFSImg2.bin", I've been attempting to upload those two, but as I said earlier, I just get "Not found" when I browse to the board IP address.
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 23, 2018, 06:02:40 PM
I managed to get ICD2 working with Windows 10 and MPLAB 8. Have to test a bit more and take screenshots and will give you instructions tomorrow. So you can don't have to worry about 4.02 but upload the latest demo.

That would be absolutely wonderful, Thank you.

Regards
Title: Re: PIC MAXI WEB - Revision A board
Post by: Stanimir5F on January 24, 2018, 08:26:54 AM
Well, I have the 4.02 archive but like I said the webpage is embedded inside the project so in order to update the page you have to update the firmware. And if you can do it's pointless to do it with 4.02. If you manage to make it work your programmer it's better to use newer versions where it is possible to update the page at runtime (via page itself).
Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 24, 2018, 01:01:19 PM
We never clarified which ICD2 you have exactly, but I hope it is PIC-ICD2-POCKET. So, to get Olimex PIC-ICD2-POCKET working under Windows 10:

1. Ensure that the proper driver is loaded. This operation might require manual driver change. When properly installed the device should be listed as "Microchip Custom USB Device" under "Custom USB Devices" tab in Windows "Device Manager".

1.1. Go to Windows "Device Manager". Use the search any type "device manager" if you have trouble.

1.2. Find how PIC-ICD2-POCKET gets listed. If you can't find it, disconnect and reconnect it until you have identified the entry associated with it. If the entry is "Microchip Win USB device" then it is NOT properly recognized and you need to change the driver.

1.3 Right-click on the entry in Windows "Device Manager". Then select “Update Driver Software” –> “Browse My Computer For Driver Software” –> “Let me pick from a list of device drivers on my computer”. In the list there should be "Microchip Custom USB Device" option make sure to select it, then click "Next" at the bottom. It looks like this:

(https://i.imgur.com/L4s4atc.jpg)

1.4 Restart computer and check in Windows "Device Manager" if the unit is now listed as "Microchip Custom USB Device" under "Custom USB Devices" tab.

2. Ensure that ICD2's configuration is set to "auto-connect".

2.1 Open MPLAB 8.92 and go to "Programmer" -> "Select Programmer" -> "MPLAB ICD2";

2.2. Go to "Programmer" -> "Connect", then "Programmer" -> "MPLAB ICD2 Setup Wizard", then in the pop-up select "Next" -> let "USB" selected, "Next" -> (!) make sure to mark the check box for the auto-connection, "Next" -> enable also the auto-download of operating system, "Next" -> "Finish.

3. Test. Remember to select the target chip. If everything is alright it should work now. Test reading the hex of the board. Notice that PIC-MAXI-WEB requires between 9V and 12V external power supply applied to the PWR terminal connector. A working setup look like this (used Windows 10 Home x64):

(https://i.imgur.com/bddI3nV.jpg)

You might need to repeat the above every time you connect your ICD2 to a different USB port!

Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 24, 2018, 02:56:45 PM
We never clarified which ICD2 you have exactly, but I hope it is PIC-ICD2-POCKET. So, to get Olimex PIC-ICD2-POCKET working under Windows 10:

1. Ensure that the proper driver is loaded. This operation might require manual driver change. When properly installed the device should be listed as "Microchip Custom USB Device" under "Custom USB Devices" tab in Windows "Device Manager".

1.1. Go to Windows "Device Manager". Use the search any type "device manager" if you have trouble.

1.2. Find how PIC-ICD2-POCKET gets listed. If you can't find it, disconnect and reconnect it until you have identified the entry associated with it. If the entry is "Microchip Win USB device" then it is NOT properly recognized and you need to change the driver.


You had my hopes up there for a minute :)

In the device driver dialogue, under Custom USB devices, I get 'Microchip Custom USB Device Properties'
then again under Device Status:
"This device cannot start (Code 10 )
Insufficient system resources exist to complete the API"

(Can't seem to insert an image here.)

The ICD2 I've got here is not the ICD2 pocket, it's the PIC-ICD2 board that's been obsoleted.

When I plug the PIC-ICD2 into the USB port Windows loads the 'Microchip Win USB device', and reports the driver working properly.

"This device cannot start. (Code 10)

The specified request is not a valid operation for the target device"

MPLab IDE gives the "Connecting to MPLAB ICD 2
ICD0019: Communications:  Failed to open port (USB): (Windows::GetLastError() = 0x0, 'The operation completed successfully.
')"

{shrug}

Thanks



Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 24, 2018, 04:36:09 PM

I've decided to cut my losses and splash out and get the PICKIT3 which should work with my MPLab X on Linux.

That was the reason I never really did much with this project - MPLab didn't work with Linux - and why the board has sat at the back of my drawer for the last couple of years.

Hopefully, that should allow me to customise the board to my needs a little more.

Thanks Stan and Lub for you help.

Title: Re: PIC MAXI WEB - Revision A board
Post by: LubOlimex on January 24, 2018, 11:42:29 PM
Alright, fair idea. Let us know if you have any trouble.
Title: Re: PIC MAXI WEB - Revision A board
Post by: APL on January 27, 2018, 09:23:47 PM
Just wanted to let you know I've managed to upgrade to 5.42 and I've got the web page, and loads more controls than I had in the 4.02 version. Very happy now.

OK, just want to say, thanks for your help. And give you advance notice that I may be asking a lot more questions in future. :)