It is currently 22 Oct 2018 10:51

All times are UTC + 1 hour




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: 12 Mar 2018 10:21 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Greetings.

I have gone through the HTTP_Demo downloaded with MikroETH 100 board and modified it to suit a PIC18F45K22.
Using the EasyPIC V7 dev-board and MikroBASIC PRO for PIC V7.2.0
Testing the code out, I can not get the page to load. And was wondering if upon a read through, someone out there might have picked up something I've missed.
I have had success getting the HTTP_Demo to work with eth-click using the PIC18F45K22.
And have used the eth-click demo code and the help files concerning SPI, SPI_Ethernet and SPI_Ethernet_24j600 to nut out the code below.
The code below compiles right and there's no issue there.

So my issue is obviously just getting the mikroETH 100 and PIC18F45K22 to play nice together and produce a web-page on my browser is all.
Can anyone out there see an issue in the code?

Thanks
Chris


' Project: MikroETH 100 PIC18F45K22 HTTP Demo
' Date: 2018-03-12
'-------------------------------------------------------------------------------
' PIC: 18F45K22 - http://www.microchip.com/stellent/groups/picmicro_sg/documents/devicedoc/cn547043.pdf
' OSC: 8MHz (4xPLL = Enabled)
'-------------------------------------------------------------------------------
' Dev-board: EasyPIC V7
' S/W: mikroBASIC PRO for PIC v7.2.0
'-------------------------------------------------------------------------------
' Add-on board: MikroETH 100 (H/W Rev 1.01) - https://www.mikroe.com/mikroeth100-board
' Connections:
'             - RC3 = SCK - AL
'             - RC4 = MISO - RD
'             - RC5 = MOSI - WR
'             - RC6 = INT - (not needed but have put it on)
'             - RC7 = CS# - CS
'
' MikroETH 100 Board pins to EasyPIC V7 Dev-board:
'                                                 CN1 - 3.3V -> 3.3V
'                                                 CN1 - GND  -> GND
'                                                 CN1 - WRH. -> ---
'                                                 CN1 - INT  -> RC6 (Not needed, but connected anyway. Is an indication of interrupt on ENC624J600)
'                                                 CN1 - AD15 -> ---
'                                                 CN1 - AD14 -> ---
'                                                 CN1 - AD13 -> ---
'                                                 CN1 - AD12 -> ---
'                                                 CN1 - AD11 -> ---
'                                                 CN1 - AD10 -> ---
'                                                 CN1 - AD9  -> ---
'                                                 CN1 - AD8  -> ---
'                                                 CN1 - AD7  -> ---
'                                                 CN1 - AD6  -> ---
'                                                 CN1 - AD5  -> ---
'                                                 CN1 - AD4  -> ---
'                                                 CN1 - AD3  -> ---
'                                                 CN1 - AD2  -> ---
'                                                 CN1 - AD1  -> ---
'                                                 CN1 - AD0  -> ---
'                                                 CN1 - GND  -> GND
'                                                 CN1 - CLK0 -> ---
'
'                                                 CN2 - GND  -> GND
'                                                 CN2 - 3.3V -> 3.3V
'                                                 CN2 - A13  -> ---
'                                                 CN2 - A14  -> ---
'                                                 CN2 - A11  -> ---
'                                                 CN2 - A12  -> ---
'                                                 CN2 - A9   -> ---
'                                                 CN2 - A10  -> ---
'                                                 CN2 - A7   -> ---
'                                                 CN2 - A8   -> ---
'                                                 CN2 - A5   -> ---
'                                                 CN2 - A6   -> ---
'                                                 CN2 - A3   -> ---
'                                                 CN2 - A4   -> ---
'                                                 CN2 - A1   -> ---
'                                                 CN2 - A2   -> ---
'                                                 CN2 - SCK. -> RC3
'                                                 CN2 - A0   -> ---
'                                                 CN2 - MISO -> RC4
'                                                 CN2 - MOSI -> RC5
'                                                 CN2 - GND  -> GND
'                                                 CN2 - CS#  -> RC7
'-------------------------------------------------------------------------------
' MikroETH 100 Jumpers:
'                      J1 (PSPCFG1) - 0,
'                      J2 (PSPCFG2) - 0,
'                      J3 (PSPCFG3) - 1,
'                      J4 (PSPCFG4) - OFF
'                      PSP MODE 5 - #Pins: min 12, max 19,
'                                 - Data Width: 8 bit,
'                                 - Address/Data Multiplexing: Yes,
'                                 - Control Lines: AL, CS, RD, WR,
'                                 - Theoretical Performance @ 10MHz (Mbits/s): <80
'-------------------------------------------------------------------------------
' Libraries:
'           - ADC (Not used as no ADC read-out in demo. Left on for future project)
'           - Conversions
'           - C_Type
'           - SPI
'           - SPI_Ethernet_24j600
'           - String
'
'-------------------------------------------------------------------------------
' Switches and pull-up/down Resistors:
'                                     - mikroETH 100 board has a pull-up resistor on the CS# line. Not used on dev-board.
'                                     - mikroETH 100 board has no pull-up/down on MISO, MOSI, SCK lines. Unknown if they are needed on dev-board.
'                                     - Researching other Mikroelektronika Ethernet boards, MISO has a 10K pull-down resistor.
'                                       Unknown if this is required here.
'                                     - For the buttons, I have placed 10K pull-down resistors on the PCB board.
'                                     - easyPIC V7 dev-board J5 set to 3.3V
'                                     - easyPIC V7 dev-board switches and jumpers set to 'neutral' or 'none' positions in all other cases.
'                                     - Port B pull-up/down switches to pull down for Buttons.
'
'-------------------------------------------------------------------------------
' Notes:
'       - MikroETH 100 board CN1 and CN2 pins soldered to 2x5 Header (Vcc, GND, RC3, RC4, RC5, RC6, RC7) which connects to PortC
'       - HTTP_Demo converted for use with PIC18F45K22 ~ Buttons and LEDs Ports changed for PIC18F45K22
'       - Trying out library "SPI_Ethernet_24j600"
'       - Mini-Webpage not loading...can not connect.
'
'-------------------------------------------------------------------------------
'*******************************************************************************
'-------------------------------------------------------------------------------
program MikroETH_100_PIC18F45K22_HTTP_Demo
'-------------------------------------------------------------------------------Declarations section
dim myMacAddr   as byte[6]    ' my MAC address
    myIpAddr    as byte[4]    ' my IP address
    gwIpAddr    as byte[4]    ' gateway (router) IP address
    ipMask      as byte[4]    ' network mask (for example : 255.255.255.0)
    dnsIpAddr   as byte[4]    ' DNS server IP address

dim getRequest  as byte[15]   ' HTTP request buffer
    dyna        as char[30]   ' buffer for dynamic response
    httpCounter as word       ' counter of HTTP requests
    txt         as string[11]


' MikroETH 100 NIC pinout
dim
SPI_Ethernet_24j600_CS as sbit at LATC7_bit             '----------------------- CS - CS# -> RC7
SPI_Ethernet_24j600_CS_Direction as sbit at TRISC7_bit  '-----------------------------------------
SPI_Ethernet_24j600_RD as sbit at LATC4_bit             '----------------------- RD - MISO -> RC4
SPI_Ethernet_24j600_RD_Direction as sbit at TRISC4_bit  '-----------------------------------------
SPI_Ethernet_24j600_WR as sbit at LATC5_bit             '----------------------- WR - MOSI -> RC5
SPI_Ethernet_24j600_WR_Direction as sbit at TRISC5_bit  '-----------------------------------------
SPI_Ethernet_24j600_AL as sbit at LATC3_bit             '----------------------- AL - SCK -> RC3
SPI_Ethernet_24j600_AL_Direction as sbit at TRISC3_bit  '-----------------------------------------
'End MikroETH 100 NIC definitions

'-------------------------------------------------------------------------------Inclusions
'-------------------------------------------------------------------------------Symbols
'-------------------------------------------------------------------------------Constants
' * ROM constant strings
' *
const httpHeader as string[30]         = "HTTP/1.1 200 OK"+chr(10)+"Content-type: "  ' HTTP header
const httpMimeTypeHTML as string[11]   = "text/html"+chr(10)+chr(10)                 ' HTML MIME type
const httpMimeTypeScript as string[12] = "text/plain"+chr(10)+chr(10)                ' TEXT MIME type
const httpMethod as string[5]          = "GET /"
' *
' * web page, splited into 2 parts :
' * when coming short of ROM, fragmented data is handled more efficiently by linker
' *
' * this HTML page calls the boards to get its status, and builds itself with javascript
' *
const indexPage as string[519] =
                    "<meta http-equiv=" + Chr(34) + "refresh"  + Chr(34) + " content="  + Chr(34) + "3;url=http://192.168.0.7"  + Chr(34) + ">" +
                    "<HTML><HEAD></HEAD><BODY>"+
                    "<h1>PIC + ENC24J600 Mini Web Server</h1>"+
                    "<a href=/>Reload</a>"+
                    "<script src=/s></script>"+
                    "<table><tr><td valign=top><table border=1 style="+chr(34)+"font-size:20px ;font-family: terminal ;"+chr(34)+"> "+
                    "<tr><th colspan=2>PORTB</th></tr>"+
                    "<script>"+
                    "var str,i;"+
                    "str="+chr(34)+chr(34)+"; "+
                    "for(i=0;i<8;i++)"+
                    "{str+="+chr(34)+"<tr><td bgcolor=pink>BUTTON #"+chr(34)+"+i+"+chr(34)+"</td>"+chr(34)+"; "+
                    "if(PORTB&(1<<i)){str+="+chr(34)+"<td bgcolor=red>ON"+chr(34)+";}"+
                    "else {str+="+chr(34)+"<td bgcolor=#cccccc>OFF"+chr(34)+";}"+
                    "str+="+chr(34)+"</td></tr>"+chr(34)+";}"+
                    "document.write(str) ;"+
                    "</script>"

const indexPage2 as string[469] =
                    "</table></td><td>"+
                    "<table border=1 style="+chr(34)+"font-size:20px ;font-family: terminal ;"+chr(34)+"> "+
                    "<tr><th colspan=3>PORTD</th></tr>"+
                    "<script>"+
                    "var str,i;"+
                    "str="+chr(34)+chr(34)+"; "+
                    "for(i=0;i<8;i++)"+
                    "{str+="+chr(34)+"<tr><td bgcolor=yellow>LED #"+chr(34)+"+i+"+chr(34)+"</td>"+chr(34)+"; "+
                    "if(PORTD&(1<<i)){str+="+chr(34)+"<td bgcolor=red>ON"+chr(34)+";}"+
                    "else {str+="+chr(34)+"<td bgcolor=#cccccc>OFF"+chr(34)+";}"+
                    "str+="+chr(34)+"</td><td><a href=/t"+chr(34)+"+i+"+chr(34)+">Toggle</a></td></tr>"+chr(34)+";}"+
                    "document.write(str) ;"+
                    "</script>"+
                    "</table></td></tr></table>"+
                    "This is HTTP request #<script>document.write(REQ)</script></BODY></HTML>"

'-------------------------------------------------------------------------------Variables
' * User defined functions
' *
' * This function is called by the library
' * The user accesses to the HTTP request by successive calls to Ethernet_24j600_getByte()
' * The user puts data in the transmit buffer by successive calls to Ethernet_24j600_putByte()
' * The function must return the length in bytes of the HTTP reply, or 0 if nothing to transmit
' *
' * If you don't need to reply to HTTP requests,
' * just define this function with a return(0) as single statement
' *
sub function SPI_Ethernet_24j600_UserTCP(dim byref remoteHost as byte[4], dim remotePort, localPort, reqLength as word,
                                         dim byref flags as TEthJ600PktFlags) as word
dim i as word        ' my reply length
    bitMask as byte  ' for bit mask
    txt as string[11]
    result = 0

    ' should we close tcp socket after response is sent?
    ' library closes tcp socket by default if canClose flag is not reset here
    '  flags.canClose = 0 ' 0 - do not close socket
    ' otherwise - close socket

    if(localPort <> 80) then          ' I listen only to web request on port 80
      result = 0
      exit
    end if

    ' get 10 first bytes only of the request, the rest does not matter here
    for i = 0 to 10
      getRequest[i] = SPI_Ethernet_24j600_getByte()
    next i

    getRequest[i] = 0

    ' copy httpMethod to ram for use in memcmp routine
    for i = 0 to 4
      txt[i] = httpMethod[i]
    next i

    if(memcmp(@getRequest, @txt, 5) <> 0) then  ' only GET method is supported here
      result = 0
      exit
    end if

    Inc(httpCounter)                           ' one more request done

    if(getRequest[5] = "s") then               ' if request path name starts with s, store dynamic data in transmit buffer
      ' the text string replied by this request can be interpreted as javascript statements
      ' by browsers

      result = SPI_Ethernet_24j600_putConstString(@httpHeader)                    ' HTTP header
      result = result + SPI_Ethernet_24j600_putConstString(@httpMimeTypeScript)   ' with text MIME type

      ' add PORTB value (buttons) to reply -------------------------------------****Buttons and LED ports changed from HTTP Demo*****
      txt  = "var PORTB="
      result = result + SPI_Ethernet_24j600_putString(@txt)
      WordToStr(PORTB, dyna)
      result = result + SPI_Ethernet_24j600_putString(@dyna)
      txt  = ";"
      result = result + SPI_Ethernet_24j600_putString(@txt)

      ' add PORTD value (LEDs) to reply
      txt  = "var PORTD="
      result = result + SPI_Ethernet_24j600_putString(@txt)
      WordToStr(PORTD, dyna)
      result = result + SPI_Ethernet_24j600_putString(@dyna)
      txt  = ";"
      result = result + SPI_Ethernet_24j600_putString(@txt)

      ' add HTTP requests counter to reply
      WordToStr(httpCounter, dyna)
      txt  = "var REQ="
      result = result + SPI_Ethernet_24j600_putString(@txt)
      result = result + SPI_Ethernet_24j600_putString(@dyna)
      txt  = ";"
      result = result + SPI_Ethernet_24j600_putString(@txt)
    else
      if(getRequest[5] = "t") then                         ' if request path name starts with t, toggle PORTD (LED) bit number that comes after
        bitMask = 0
        if(isdigit(getRequest[6]) <> 0) then               ' if 0 <= bit number <= 9, bits 8 & 9 does not exist but does not matter
          bitMask = getRequest[6] - "0"                    ' convert ASCII to integer
          bitMask = 1 << bitMask                           ' create bit mask
          LATD   = PORTD xor bitMask                      ' toggle PORTD with xor operator
        end if
      end if
    end if

    if(result = 0) then ' what do to by default
      result = SPI_Ethernet_24j600_putConstString(@httpHeader)                  ' HTTP header
      result = result + SPI_Ethernet_24j600_putConstString(@httpMimeTypeHTML)   ' with HTML MIME type
      result = result + SPI_Ethernet_24j600_putConstString(@indexPage)          ' HTML page first part
      result = result + SPI_Ethernet_24j600_putConstString(@indexPage2)         ' HTML page second part
    end if

    ' return to the library with the number of bytes to transmit
end sub
'
'' *
'' * this function is called by the library
'' * the user accesses to the UDP request by successive calls to Ethernet_24j600_getByte()
'' * the user puts data in the transmit buffer by successive calls to Ethernet_24j600_putByte()
'' * the function must return the length in bytes of the UDP reply, or 0 if nothing to transmit
'' *
'' * if you don't need to reply to UDP requests,
'' * just define this function with a return(0) as single statement
'' *
'' *
sub function SPI_Ethernet_24j600_UserUDP(dim byref remoteHost as byte[4],
                              dim remotePort, destPort, reqLength as word, dim byref flags as TEthJ600PktFlags) as word

    result = 0          ' UDP not required
end sub
'
'-------------------------------------------------------------------------------PIC Power Up or Reset Settings
Sub procedure PIC_Init()

    ANSELA = 0                   ' Configure PORTA pins as digital
    ANSELB = 0                   ' Configure PORTB pins as digital
    ANSELC = 0                   ' Configure PORTC pins as digital
    ANSELD = 0                   ' Configure PORTD pins as digital
    ANSELE = 0                   ' Configure PORTE pins as digital

    ADCON0 = 0x00                ' Disable ADC.
    ADCON1 = 0x00                '
    ADCON2 = 0x00                '

    TRISA = 0x00                 ' Configure all as output and clear for now.
    'LATA = 0x00                  '
    PortA = 0x00                 '

    'ANSELA = 0x08                ' Configure PORTA pin 3 as Analogue Input (AN3) ****Future project*******
    'TRISA3_bit = 1               ' Configure RA3 pin as input

    TRISB = 0xFF                 '
    'LATB = 0x00                  '
    PortB = 0x00                 '

    'TRISC = 0x00                 '
    'LATC = 0x00                  '
    'PortC = 0x00                 '

    TRISD = 0x00                 '
    'LATD = 0x00                  '
    PortD = 0x00                 '

    TRISE = 0x00                 '
    'LATE = 0x00                  '
    PortE = 0x00                 '

    httpCounter = 0
End sub

main:
'-------------------------------------------------------------------------------Main program
  'PIC18F45K22 set-up
  PIC_Init()

  ' Set mac address
  myMacAddr[0] = 0x00
  myMacAddr[1] = 0x14
  myMacAddr[2] = 0xA5
  myMacAddr[3] = 0x76
  myMacAddr[4] = 0x19
  myMacAddr[5] = 0x3F

  ' Set IP address ----------------- 192.168.0.7 works with Eth Click HTTP Demo and is an unused IP address with router.
  myIpAddr[0] = 192
  myIpAddr[1] = 168
  myIpAddr[2] = 0
  myIpAddr[3] = 7

  ' Set gateway address ------------ 192.168.0.1 Gateway address found on ipconfig/all and in router
  gwIpAddr[0]  = 192
  gwIpAddr[1]  = 168
  gwIpAddr[2]  = 0
  gwIpAddr[3]  = 1

  ' Set dns address ---------------- 192.168.0.1 DNS address found on ipconfig/all and in router
  dnsIpAddr[0] = 192
  dnsIpAddr[1] = 168
  dnsIpAddr[2] = 0
  dnsIpAddr[3] = 1

  ' Set subnet mask ---------------- 255.255.255.0 Subnet Mask address found on ipconfig/all and in router
  ipMask[0]    = 255
  ipMask[1]    = 255
  ipMask[2]    = 255
  ipMask[3]    = 0
 
  SPI1_Init()                                                                                     ' Start SPI-1
  SPI_Ethernet_24j600_Init(myMacAddr, myIpAddr, _SPI_Ethernet_24j600_AUTO_NEGOTIATION )           ' Initiate ethernet module
  SPI_Ethernet_24j600_setUserHandlers(@SPI_Ethernet_24j600_UserTCP, @SPI_Ethernet_24j600_UserUDP) ' Set user handlers

  ' DHCP will not be used here, so use preconfigured addresses
  SPI_Ethernet_24j600_confNetwork(ipMask, gwIpAddr, dnsIpAddr)

while TRUE                                                                      ' Do forever
      SPI_Ethernet_24j600_doPacket()                                            ' Process incoming Ethernet packets
'     *
'     * add your stuff here if needed
'     * Ethernet_24j600_doPacket() must be called as often as possible
'     * otherwise packets could be lost
'     *
wend
end.


Top
 Profile  
 
PostPosted: 16 Mar 2018 09:13 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 423
Location: Belgrade
Hi,

I`m working on your problem, if i found out something i`ll let you know.

Regards,

Petar


Top
 Profile  
 
PostPosted: 16 Mar 2018 19:47 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Hi Petar,

Thanks for taking the time to have a look at this issue. I really appreciate it. :D

I have been wondering if the solution to the problem could be found in the oscillator attached to the PIC18F45K22?
At present, I've got an 8MHz crystal, the one on the easyPIC V7 dev-board.
And when I re-read the SPI_Enternet_24j600 library help file, there's something up in the top paragraph or so (sorry, I'm remembering all of this, as I'm not currently at the computer I use when tinkering with Mikroelektronika), about using a 38 to 40MHz oscillator, or the ENC24J600's CLKOUT pin to provide timing to the MCU...if I remember correctly, it states something about a silicon bug with SPI.

So, if the issue is that the MikroETH 100 and PIC18F45K22 needs a higher frequency oscillator, that's solvable. My problem with that is, finding exactly where in the PIC18F45K22 datasheet it states anything about minimum and maximum external crystal speeds. The best I can do is find 16MHz for an external crystal. And if one uses the "4xPLL = enable", that only takes the MCU clock speed up to 32MHz, 6MHz shy of the library 38MHz minimum.

Hopefully the PIC18F45K22 might be able to handle a 40MHz crystal. But at the moment I'm not sure. I know you will have a better idea about how to tackle the problem, but I thought I'd bring this up as it struck me a few days out from posting this topic.

Thanks again.
Chris


Top
 Profile  
 
PostPosted: 19 Mar 2018 11:16 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 423
Location: Belgrade
Hi,

Your code looks ok and solid and for now, so the problem could be oscillator related.

First i tried to rewrite code using the old Parallel library for en24j600,
from the mikro eth100 example for PIC18F87J60 and LV18F v6 board,
but quickly i abandoned it, finding the old library isn't working as i wanted to.

So, for now, i`m going line by line and i will try to re-read the datasheet for PIC18F45K22 to see about that clock speeds.
It would be great improvement if we could at least ping the module through the lan.

Regards,
Petar


Top
 Profile  
 
PostPosted: 19 Mar 2018 20:01 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Hi Petar,

Thank you for verifying the code. That's a relief to have a second opinion come back with a positive review. :D

I have ordered a 40MHz crystal that's coming in the mail soon and have a PIC18F45K22 mcu I am willing to 'sacrifice to the gods of experiments' (so to speak), to try that combination out.... for science of course :lol: So fingers crossed that might be it.

Also, I have been trying to re-read the datasheet for the mcu too, when time away from work and other duties allows, but it's still a little unclear what the actual min/max speeds are regarding crystals. So anything you find (or that I find) would be a great resource to post here for future users. If I do find anything I'll put it here in comments.

Failing all of that, the only other possible solution might be to try using the ENC24J600 CLKOUT pin to clock the mcu. I know there's a few past posts that have asked questions about utilizing this feature of the ENC24J00. Again, I think about two things surrounding clock speeds and compatibility regarding this thought. One would be, at what speed does the ENC24J600 output on this pin? And two, would the PIC18F45K22 be able to handle it? Regarding the second thought, again, it would be helpful to have a more clearly defined section on min/max operating clock speeds for the PIC18F45K22 in the datasheet. And regarding thought one, I should look that query up in the datasheet for the ENC24J600 (which I do have and have given only a passing glance at best).

Lastly Petar, I wish to thank you very much for you're time and effort with my post/issue here. It's great to know there are Mikroelektronika team members willing to give up their time and 'know-how' to help out users like me (a hobby level enthusiast at best). I really appreciate it and look forward to any conclusion you find...hopefully that a 40MHz crystal will work and as you say can at least ping the project, but even (worst comes to worst) that both of us have tried and come back to say the PIC18F45K22 really isn't a sufficient mcu for the ENC24J600. The knowledge will be useful to others, and that's what counts.

Regards
Chris


Top
 Profile  
 
PostPosted: 20 Mar 2018 10:08 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Okay... so an update.

After scouring the net forums for clock speeds and ideas/leads, I came back to the Absolute Maximum Ratings pages of the datasheet.
I did look at this diagram before. And it was the basis for ordering the 40MHz crystal to experiment with. So I think it will have to do for now.
As I plan to run the project at 3.3V anyway, in Figure 27-1 and Figure 27-2, 40MHz is within the min and max fields shown in grey.
So I tentatively believe the project should work, given what the library says about using a 38 - 40MHz crystal with the ENC24J600.
(I have added the black lines to show where the project parameters lay.)

Image


Top
 Profile  
 
PostPosted: 20 Mar 2018 13:25 
Offline

Joined: 27 Jun 2010 12:07
Posts: 984
Location: England
Look at table 27-6 of the datasheet.

Maximum frequency for a 2-pin crystal is 20 MHz.

To acheive 40 MHz fsys, use a 10 MHz 2-pin crystal and HS-PLL mode.


Top
 Profile  
 
PostPosted: 21 Mar 2018 08:44 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Hi hexreader,

Thanks for the information there. Very helpful. I'm posting the Table 27-7 and in blue, highlighting the condition, and in red your findings confirmed.

Lucky the 40MHz crystal wasn't too expensive... :roll: :lol: Will save it for another project. :wink:

Okay, so great idea, I'll get a 2-pin 10MHz crystal and as you suggest, try out the project with HS-PLL mode active.

Cheers
Chris

Image


Top
 Profile  
 
PostPosted: 21 Mar 2018 13:34 
Offline

Joined: 27 Jun 2010 12:07
Posts: 984
Location: England
While you have an order in, you might want to buy 12 and/or 16MHz crystal too, so you can have the maximum 48 or 64MHz Fcy depending on temperature range of your chip.

Assuming 40 pin DIL chip:

I/P written on chip indicates industrial temperature range (64MHz max)
E/P for extended temperature range (48MHz max)


Top
 Profile  
 
PostPosted: 22 Mar 2018 09:10 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Thanks for the help hexreader. I checked the 40-pin chip and it's I/P (industrial).

So I tried out the 10MHz crystal and the project still doesn't bring up a webpage unfortunately (time out). And I can't ping the device either using command prompt (Admin).

Some good news, LED A is solid and LED B blinks, which is a slight improvement at least. Before there wasn't much of that.

I can get the 16 MHz crystal tomorrow during a lunch break, as the electronics store is around the other side of the block I'm working at, which is handy. 8)

Will post the results of my experiments after work. Wish us luck :wink:

And again, thanks for the help/ideas. Much appreciated.


Top
 Profile  
 
PostPosted: 23 Mar 2018 09:28 
Offline

Joined: 15 Jun 2011 06:37
Posts: 100
Just tried the 16MHz crystal.... sadly same result as the 10MHz crystal. LED A is on, LED B blinks, but can not raise webpage, nor ping the chip. :cry:

So I'm stuck for options now. Hopefully Petar has had better luck.


Top
 Profile  
 
PostPosted: 26 Mar 2018 10:36 
Offline
User avatar

Joined: 05 Mar 2018 09:44
Posts: 423
Location: Belgrade
Hi,

Just to ping in :D, sadly no, i`m still trying to make it work.
I`ll post here as soon as i got some positive results.

Kind regards,
Petar


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: