Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2024, 08:25:04 08:25


Login with username, password and session length


Pages: [1]
Print
Author Topic: PIC with Ethernet And I2C  (Read 4856 times)
0 Members and 1 Guest are viewing this topic.
orpheedulogis
Junior Member
**
Offline Offline

Posts: 72

Thank You
-Given: 10
-Receive: 2


« on: November 19, 2010, 05:22:13 17:22 »

Hi all

Actually I use mikrobasic,  PIC4553 ("Soft_i2C") and Proteus for simulation.
Now, I would like to have a PIC, if possible with a 12 bits ADC, with Ethernet and hardware I2C.
This is for my electric motorcyle ( www.motoelectrique.unblog.fr ) but, in fact, I want first to learn how to do for ethernet connections so I can make new (RFID) projects.

That's why I'm asking for best PIC you can propose to me.

Also, I have a (small) problem actually.
My actual electric  motorcyle project do many things and I would like "lighten" for increasing speed. For example, I would be interested to use a small PIC like 12F675 in slave I2C mode so it can send speed information or other things when asked by I2C (instead of using PIC4553 interrupt to do so).


Thanks for help



Posted on: November 19, 2010, 05:49:30 17:49 - Automerged

The first thing I can see that's it's seems impossible to use ethernet and I2C  Embarrassed
Is it so ?
Logged
Suky
Guest
« Reply #1 on: November 19, 2010, 06:35:53 18:35 »

Search for it yourself:  Wink

http://www.microchip.com/maps/main.aspx

Logged
orpheedulogis
Junior Member
**
Offline Offline

Posts: 72

Thank You
-Given: 10
-Receive: 2


« Reply #2 on: November 19, 2010, 07:12:16 19:12 »

Thanks for your answer
Nice link.

But it's not very clear for me: what did I need exactly to have ethernet and I2C capacities ? two SDA/SCL, right ?
It would be fine if I could find small package PIC with this so I can have a master PIC and a slave one on same board, one to prepare ADC values, speed value ... and the other for main functions.
And I need Proteus compatibilty of course !  Roll Eyes if PIC with some demonstration examples it would be perfect too  Cool

Simple, isn't it ?  Grin

Logged
orpheedulogis
Junior Member
**
Offline Offline

Posts: 72

Thank You
-Given: 10
-Receive: 2


« Reply #3 on: November 19, 2010, 09:17:37 21:17 »

And what about this:

PIC18F4523

I know: it does'nt have two SDA pins but it have 12 bits ADC (like PIC4553) and a real I2C

I searched and found a DS1374. Do you think it would be interesting I put speed pulse to this I2C and ask for value so I can deliver my PIC from speed pulse interrupts ?

Thanks
Logged
orpheedulogis
Junior Member
**
Offline Offline

Posts: 72

Thank You
-Given: 10
-Receive: 2


« Reply #4 on: November 20, 2010, 12:03:56 00:03 »

OK, now I tried PIC18F4523 on proteus simulation but I have a problem

My software was working for PIC4553

I just changed Soft_I2C -> I2C1

I tried to pour HS+PLL but proteus failed (too much speed I suppose) so I put "HS" only
For test I have a blinking LED
This shows me software stop when I ask for I2C, in fact as soon as I have I2C start
Where could be the problem ?
Thanks

in Main

Quote

  TRISA  = %00001111         ' PORT A
  TRISB  = %00011011         ' PORT B
  TRISC  = %10000100         ' PORT C
  TRISD  = %01010011         ' PORT D
  TRISE  = %00000000         ' PORT E

  PortA=%00110000 '
  PortB=%00000000
  PortC=%00100000
  PortD=%00000000
  PortE=%00000000
 
  OSCTUNE=0 'réglage par défaut
  UART1_Init(9600)

  CMCON = 0X07        ' Turn off all comparators.
  INTCON=0 'pas d'interruption
  ADCON0 = 0x01       ' choix canal convertisseur A/D (ici=1)
  ADCON1 = 0X00       ' Reset registre A/D 1.
  ADCON1 = %1100  ' activation AN2,AN1,AN0
  I2C1_init(100000)
  Lcd_Init()
  Lcd_Cmd(_LCD_CURSOR_OFF)

  INTCON.INT0IE = 1     
  INTCON.INT0IF = 0     

  INTCON3.INT1IE = 1   
  INTCON3.INT1IF = 0   
  INTCON3.INT1IP= 0   

  INTCON.INTEDG0=1
  INTCON2.INTEDG1=1 
  INTCON.GIE = 1     


.........

  BlinkKeybLed(3) ' for test
 
  LireEepromWord(ConvAdress)
 
  BlinkKeybLed(3) ' for test
   
............

Here the sub

Quote

Sub function LireEepromWord(dim AdresseDonnee as word) as word

dim OctetLu as byte


   I2C1_Start() '-> here it wait
   I2C1_Wr(Adresse24C512) 
   I2C1_Wr(hi(AdresseDonnee))
   I2C1_Wr(lo(AdresseDonnee))
   I2C1_Start()
   I2C1_Wr(Adresse24C512 or %00000001)
   OctetLu=I2C1_Rd(1)
   result=OctetLu*256+I2C1_Rd(0)
   I2C1_Stop()

end sub


The advantage with 4523 is it seems to be approximatively compatible to 4553 ... it seems  Roll Eyes

Thanks for help
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC