Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - Markus Gritsch

256
Web platform / Re: The webbserver stops, Problems with ENC28J60??
It's not about finding a fix.  Either commenting out the CKE = 1 line or adding the SMP = 1 line fixes the instability.  It's about understanding *why* this fixes the instability.  The original settings in the ENC28J60 file should be correct, according to the timing diagrams in the data sheets.
257
Web platform / Re: The webbserver stops, Problems with ENC28J60??
Here is another piece to the puzzle: I can get the same stable SPI communication if I leave the original CKE = 1 in place, but add an additional SMP = 1 to the configuration, so that the data is sampled at the end of the data time.  SMP must be set after MSTEN, so the modified code in ENC18J60.c reads
[tt:]   ENC_SPICON1bits.CKE = 1;
   ENC_SPICON1bits.MSTEN = 1;
   ENC_SPICON1bits.SMP = 1; // line inserted
   ENC_SPISTATbits.SPIEN = 1;[/tt:]
Does this shed any light on this strange issue for someone?
259
Web platform / Re: Current status of webserver software
ad 2: Dynamic variable substitution works fine with the EEPROM webserver.  No issues there.  The Microchip SD card example firmware has still problems with dynamic variable substitution.  It does not really work reliably there.
260
Web platform / Re: The webbserver stops, Problems with ENC28J60??
The modified EEPROM Server is approaching 72 hours of continuous uptime now, steadily serving 100+ requests per second without the slightest hiccup.

Because I have only one Web Platform, I am going to stop the "long term" test now, because I like to try out other things.

Taking into accout, that the fixed firmware also worked at a test run at 50 MIPS overclocked for several hours, and that the SPI clock can now be choosen freely (compared to be very picky at the clock speed without the fix), I would say the fix is correct.

The next step would be to understand why it works so much better now, despite the fact that according to the data sheets it should not.  Ian, any progress on the timing analysis using an oszilloscope?  Maybe we should bring it up on the Microchip forum.  Is it read by Microchip engineers?
261
Web platform / Re: The webbserver stops, Problems with ENC28J60??
Looking forward to your investigation.

Maybe others can also contribute to the long term stability test.  I attached the modified firmware (the only modification is the commented out CKE line) and the Microchip test website.  Please try them on your Web Platform.
262
Web platform / Re: The webbserver stops, Problems with ENC28J60??
I had it running for 4 hours at 50 MIPS overclocked, then I switched back to the nominal 40 MIPS, since the dsPIC gets a bit warm when running at 50 MIPS (but not as hot as the ENC28J60).  Having the EEPROM server running since then serving 100 requests per second (caused by the AJAX request every 10 ms from the Microchip SolutionsTCPIP Demo AppWebPages2 content).  Still running.

This really seems to be the correct setting, since now the SPI clock in ENC_SPICON1 can be set to almost an arbitrary value (1:1 for the primary and 1:1 for the secondary prescaler is not recommended by the data sheet).  It works from 0b00000 (40 MHz / (8 * 64) = 78125 Hz) resulting in ping times of about 35 ms :) to 0b11011 (40 MHz / 2 = 20 MHz).

While it is nice that it seems to work now (of course only time will tell), it is a bit unsatisfying because I cannot yet understand why.  Section 4.1 of the ENC28J60 data sheet [1] shows timing diagrams and says "[...] data being clocked in on the rising edge of SCK".  The timing diagram on page 18-10 of the dsPIC33F Family Reference Manual [2] shows that SDO changes on the rising edge and is stable on the falling edge of SCK with our settings (CKE = 0, CKP = 0).  This does not make sense.  Any thoughts?

[1] http://ww1.microchip.com/downloads/en/D ... 39662c.pdf
[2] http://ww1.microchip.com/downloads/en/D ... 70206C.pdf
263
Web platform / Re: The webbserver stops, Problems with ENC28J60??
Yay!  I think I have found the problem!

Without the fix, stability is good when run at 40 MHz / 20 MIPS (PLLFBD=20) as used in the @tweet_tree, but degrades with increasing clock rate.  At 80 MHz / 40 MIPS (PLLFBD=41) the web server frequently stops from responding after a few minutes.  At an even more increased speed, the web server does not serve pages at all.

I am quite confident that I spotted the problem, because I have the web server now running for about 3 hours, at 100 MHz / 50 MIPS (PLLFBD=52) overclocked, without any stability issues :D

It seems, that (at least for the Web Platform) the serial SPI output changes on the wrong edge of the clock.  After commenting out line 224 in ENC28J60.c
[tt:]    //ENC_SPICON1bits.CKE = 1;[/tt:]
everything is fine.

Ian, can you imagine why CKE is explicitely set in ENC28J60.c?  Could this be a bug or might it be necessary for other board designs like the Explore 16?
265
Web platform / Re: Dynamic Variables (~inc:header.inc~) in SD Card Server not working
By stepping through HTTP2_MDD.c (which really is a mess of a state machine) I noticed, that the files 'DynRcrd.bin' and 'FileRcrd.bin', which are generated by MPFS2, have to be copied to the SD card too.

I did this, and now I get the attached screenshot.png.  Including ~inc:header.inc~ seems to work, but a lot of the other dynamic variables remain unsubstituted.

The LED in the browser is blinking, but when clicking a bit through the menu on the left side, the Web Platform locks up.  The LD1 on the board stops blinking and the debugger shows that it hangs in line 661 in SD-SPI.c:

                   while (!SPISTAT_RBF);

Maybe access to files on the SD is not very reliable?
269
Web platform / Re: The webbserver stops, Problems with ENC28J60??
Yes, the same TCPIP stack, but the SD server is obviously doing something different compared to the EEPROM server, since it keeps running at full PIC speed.  Maybe the EEPROM routines trigger some race condition?
270
Web platform / Re: The webbserver stops, Problems with ENC28J60??
I tried the SD server demo as mentioned by mcdanne82, and the server is running without problems for over 8 hours and counting.  The original ENC28J60 SPI clock frequency is used, and the PIC is running at 40 MIPS.

Ian, on which demo is the tweet tree firmware based on?

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01712445352session_write_close ( )...(null):0
20.01752576968ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01752577744Database_MySQL->query( ).../DatabaseHandler.php:119
40.06282716504Database_MySQL->error( ).../Db-mysql.class.php:273