Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

M32 hangs @Config Tcpip with bascom samples.

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> EASY TCP/IP
View previous topic :: View next topic  
Author Message
dk_akj

Bascom Member



Joined: 14 Sep 2004
Posts: 94

blank.gif
PostPosted: Sun Nov 18, 2007 9:42 pm    Post subject: M32 hangs @Config Tcpip with bascom samples. Reply with quote

Hi all Bascommers.

I've bought a Easy TCP/IP developer board, a adapterbord and a nm7010a.

After figthing with it for 6 hours I need some help.

My problem is that nomather witch sample I test it hangs when entering this line:
Config Tcpip = Int0 , Mac = 12.128.12.34.56.78 , Ip = 192.168.0.25 , Submask = 255.255.255.0 , Gateway = 192.168.0.1 , Localport = 1000 , Tx = $55 , Rx = $55 , Twi = &H80 , Clock = 400000 , Timeout = 1000000



Header of bas file:
'-----------------------------------------------------------------------------------------
'name : PING_TWI.bas http://www.faqs.org/rfcs/rfc792.html
'copyright : (c) 1995-2005, MCS Electronics
'purpose : Simple PING program
'micro : Mega88
'suited for demo : yes
'commercial addon needed : no
'-----------------------------------------------------------------------------------------
$regfile = "m32def.dat" ' specify the used micro

$crystal = 8000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 128 ' default use 32 for the hardware stack
$swstack = 128 ' default use 10 for the SW stack
$framesize = 80 ' default use 40 for the frame space


Const Cdebug = 1

Const Sock_stream = $01 ' Tcp
Const Sock_dgram = $02 ' Udp
Const Sock_ipl_raw = $03 ' Ip Layer Raw Sock
Const Sock_macl_raw = $04 ' Mac Layer Raw Sock
Const Sel_control = 0 ' Confirm Socket Status
Const Sel_send = 1 ' Confirm Tx Free Buffer Size
Const Sel_recv = 2 ' Confirm Rx Data Size

'socket status
Const Sock_closed = $00 ' Status Of Connection Closed
Const Sock_arp = $01 ' Status Of Arp
Const Sock_listen = $02 ' Status Of Waiting For Tcp Connection Setup
Const Sock_synsent = $03 ' Status Of Setting Up Tcp Connection
Const Sock_synsent_ack = $04 ' Status Of Setting Up Tcp Connection
Const Sock_synrecv = $05 ' Status Of Setting Up Tcp Connection
Const Sock_established = $06 ' Status Of Tcp Connection Established
Const Sock_close_wait = $07 ' Status Of Closing Tcp Connection
Const Sock_last_ack = $08 ' Status Of Closing Tcp Connection
Const Sock_fin_wait1 = $09 ' Status Of Closing Tcp Connection
Const Sock_fin_wait2 = $0a ' Status Of Closing Tcp Connection
Const Sock_closing = $0b ' Status Of Closing Tcp Connection
Const Sock_time_wait = $0c ' Status Of Closing Tcp Connection
Const Sock_reset = $0d ' Status Of Closing Tcp Connection
Const Sock_init = $0e ' Status Of Socket Initialization
Const Sock_udp = $0f ' Status Of Udp
Const Sock_raw = $10 ' Status of IP RAW

Config Com1 = Dummy , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0


Dim X As Byte

Config Portc.2 = Output
Q_test Alias Portc.2

For X = 1 To 5
Print "Init TCP " + Str(x)
Wait 1
Toggle Q_test
' display a message
Next


Reset Q_test
'we do the usual
Print "Enable interrupts"

Enable Interrupts
Print "Enable interrupts - OK"



' before we use config tcpip , we need to enable the interrupts
Config Tcpip = Int0 , Mac = 12.128.12.34.56.78 , Ip = 192.168.0.25 , Submask = 255.255.255.0 , Gateway = 192.168.0.1 , Localport = 1000 , Tx = $55 , Rx = $55 , Twi = &H80 , Clock = 400000 , Timeout = 1000000
Print "Init done"
Set Q_test



On my terminal I see:
Init TCP 1
Init TCP 2
Init TCP 3
Init TCP 4
Init TCP 5
Enable interrupts
Enable interrupts - OK

But never:
"Init done"

q_test ( a LED) is flashing during for next, but is not set after the config either.

I cant ping the module, LED's are on, yellow led flashing (turns of for a few MS every 1-2 secs.

JTAG is disabled

Chip settings in bascom:


I2C settings (is this needed ?)



Compiler version :1.11.9.0
Compiler build :1.11.9.0.001
IDE version :1.11.9.0
Serial number :xxxxxxxxxxxxx
Windows OS :Microsoft Windows XP
Windows SP :Service Pack 2
Explorer :7.0.5730.11
Company :
Owner :Anders Kjær
Windows dir :C:\WINDOWS
App data dir :C:\Documents and Settings\Anders\Application Data
System dir :C:\WINDOWS\system32



Any ideas to solve this problem ??

Thanks in advance
Anders
Back to top
View user's profile MSN Messenger
dk_akj

Bascom Member



Joined: 14 Sep 2004
Posts: 94

blank.gif
PostPosted: Mon Nov 19, 2007 8:34 pm    Post subject: Reply with quote

Problem solved, the dummy (me) had used 470R instead of 4K7 as pullups on TWI Embarassed

Anders
Back to top
View user's profile MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> EASY TCP/IP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum