Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Mega32 hangs @ Config Tcpip = Int0 ........

 
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:40 pm    Post subject: Mega32 hangs @ Config Tcpip = Int0 ........ 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 ?)



Any ideas what can be wrong ?

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

Bascom Member



Joined: 13 Nov 2007
Posts: 4

blank.gif
PostPosted: Fri Dec 14, 2007 6:35 pm    Post subject: Reply with quote

Yep, same over here. It really drives me crazy Confused

I get the "Init TCP" on my serial console.

Also the Link / TX leds on the RJ45 don't light up after a reset when connected to my Linksys WRT54GL router. Connected to a sweex 8 port switch (yes I know juck Cool ) the do after a few seconds after the reset.

The IIM7010A I'm using is a REV1.1. Is that one still compatible ?

I'm a old bascom 8051 user so I used the Bascom AVR Demo version to play around a little bit.

Bascom AVR version (from about) :

Compiler version :1.11.8.7
Compiler build :1.11.8.7.001
IDE version :1.11.8.7
Serial number :Serial DEMO
Windows OS :Microsoft Windows XP
Windows SP :Service Pack 2
Explorer :6.0.2900.2180
Company :
Owner :Asus
Windows dir :C:\WINDOWS
App data dir :C:\Documents and Settings\lex\Application Data
System dir :C:\WINDOWS\system32
Back to top
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 386
Location: Wuppertal, Germany

germany.gif
PostPosted: Sat Dec 15, 2007 12:12 am    Post subject: Reply with quote

Iīve had that problem too. In my case, the solution was easy:
There are two different adapterbords avaliable from MCS.
The discrete, and the SMD type. They differe in the DIP-Switch settings:
When using the MCS-samples, the TWI-adress is H08. To set the adress, the DIP-switch is used.
On the conventional adapter: Only DIP7 and DIP8 are set in position OFF.
On the SMD-adapter:Only DIP8 is set in position OFF.
That cost me 3 days...
Back to top
View user's profile
lmb_nl

Bascom Member



Joined: 13 Nov 2007
Posts: 4

blank.gif
PostPosted: Sat Dec 15, 2007 9:03 pm    Post subject: Reply with quote

I had to read the manual 2 times to completely understand it, but found the correct adres and settings (I use the SMD version). The TWI bus shows the SDA SCL bit activity (monitoring by a scoop) but no success yet Sad

I will try to find out what's wrong for a week after that I will assume that IIM7010A is defect or I mashed up the adapter board. Maybe I will sell the board (with a free AS/IS IIM7010A Wink ) and start looking for a new challenge.

There is a new AVR32 devboard available with Linux on it Very Happy
Back to top
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 386
Location: Wuppertal, Germany

germany.gif
PostPosted: Sat Dec 15, 2007 11:11 pm    Post subject: Reply with quote

donīt give up that easy!
Try my little Programm for TCP/IP beginners. make shure all settings of COM-ports and IPs fit your system. If you are not shure how to config your router, make a direct connection NM7010A to PC Network-card with an crossover patchcable.
Back to top
View user's profile
Arera

Bascom Member



Joined: 23 Sep 2007
Posts: 386
Location: Wuppertal, Germany

germany.gif
PostPosted: Sat Dec 15, 2007 11:17 pm    Post subject: Reply with quote

Here is the telnet-to-AVR and the TCP/IPboard-COM hyperterminal connection to download:
Back to top
View user's profile
lmb_nl

Bascom Member



Joined: 13 Nov 2007
Posts: 4

blank.gif
PostPosted: Sun Dec 16, 2007 8:18 pm    Post subject: Reply with quote

Thanks for the program but, nope. Doesn't work.

May I should ask : does somebody live in Twente (NL) which also has a EASY TCP/IP board ? So we could compare the two boards? Very Happy
Back to top
View user's profile
lmb_nl

Bascom Member



Joined: 13 Nov 2007
Posts: 4

blank.gif
PostPosted: Thu Dec 27, 2007 4:04 pm    Post subject: Reply with quote

Ok, i had it. It now has have taken me weeks to try to get the board to work. I will now assume that IIM7010A is defect or I mashed up the adapter board. Confused

If any one is interested my Easy TCP/IP TWI Mother Board and the Easy TCP/IP TWI Adapter Board (with a AS/IS IIM7010A on it) are on sale for euro 20,00 (excl shipping).
Back to top
View user's profile
Butterfly

Bascom Member



Joined: 24 Sep 2006
Posts: 31

belgium.gif
PostPosted: Mon Dec 31, 2007 9:35 am    Post subject: Reply with quote

Hello,

i have a system here that's running perfect,
if you want it i can test the adaptor board witht the 7010A.


bartc
Back to top
View user's profile
Butterfly

Bascom Member



Joined: 24 Sep 2006
Posts: 31

belgium.gif
PostPosted: Mon Dec 31, 2007 9:35 am    Post subject: Reply with quote

Hello,

i have a system here that's running perfect,
if you want it i can test the adaptor board witht the 7010A.


bartc
Back to top
View user's profile
dk_akj

Bascom Member



Joined: 14 Sep 2004
Posts: 94

blank.gif
PostPosted: Sun Jan 20, 2008 8:30 pm    Post subject: Reply with quote

Sorry for getting back so late, I thought I had posted my solution.

The problem for me was that I had used 470R instead of 4K7R as pullups on sda and scl.

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

Bascom Member



Joined: 14 Sep 2004
Posts: 94

blank.gif
PostPosted: Sun Jan 20, 2008 8:32 pm    Post subject: Reply with quote

Hmm, seems that I have created 2 posts within 2 minutes....

http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&t=5067

Anders
Back to top
View user's profile MSN Messenger
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri May 02, 2008 12:05 am    Post subject: Reply with quote

470 ohm is indeed too much pull down. Yes, such a mistake can drive you crazy. Thanks for the follow up.
With the help of the forum topics everybody should be able to get it working.
If not, you can contact MCS for a check/repair.

_________________
Mark
Back to top
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Fri May 02, 2008 12:06 am    Post subject: Reply with quote

470 ohm is indeed too much pull down. Yes, such a mistake can drive you crazy. Thanks for the follow up.
With the help of the forum topics everybody should be able to get it working.
If not, you can contact MCS for a check/repair.

_________________
Mark
Back to top
View user's profile Visit poster's website
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