Showing posts with label hardware. Show all posts
Showing posts with label hardware. Show all posts

May 16, 2014

Módulo de acesso a redes TCP/IP ENC28J60

Ola

Já faz algum tempo que não posto nada sobre Arduino / sistemas embarcados; bom, como você já deve saber... ok, não vou usar a velha desculpa de falta de tempo.

Estou aqui para dizer que não estou estagnado no meu aprendizado sobre o Arduino e também para falar sobre minha última vitória; a mais ou menos um ano e meio, eu comprei um módulo Ethernet (ENC28J60) igual ao que segue abaixo para fazer alguns experimentos.

Acontece que eu nunca consegui fazer o mesmo funcionar; acabei apelando e comprando um Ethernet Shield (baseado no W5100) o qual funcionou sem maiores problemas. Outro dia eu estava mexendo nas minhas tralhas de eletrônica e encontrei o dito cujo (aquele que eu não havia conseguido fazer funcionar) e decidi que iria tentar novamente.

Depois de ler vários blogs, artigos, etc na internet, acabei obtendo sucesso. Abaixo segue a configuração que eu utilizei:
Veja abaixo como ficaram as conexões:

ArduinoENC28J60
ICSP
HEADER
MISOSO
MOSISI
SCKSCK
RESETRST
PINOS
I/O
VCC (3.3V)VCC
GNDGND
10CS
INT(2)INT






Veja abaixo um ótimo diagrama do Arduino Leonardo.



Observe que no Arduino Mega / Uno e outros, o conector ICSP também esta conectado aos pinos normais de I/O (mas não no Leonardo).


Como eu comentei, tive que fazer uma mudança na biblioteca utilizada para acessar o módulo. Básicamente no arquivo EtherCard/enc28j60.cpp eu mudei:

void ENC28J60::initSPI () {
    pinMode(SS, OUTPUT);
    digitalWrite(SS, HIGH);

    // rest of the code....
}

para:

void ENC28J60::initSPI () {
     pinMode(10, OUTPUT);
     digitalWrite(10, HIGH);


    // rest of the code....

Isso porque o pino SS esta definido com um valor (17) diferente do pino que eu escolhi, 10.

E pronto! Depois disso foi só abrir um dos exemplos da biblioteca, modificá-lo um pouco e temos temos um web server rodando no Arduino.

O que você acha? Eu acho isso muito massa ;)

Não hesite em deixar comentários / perguntas / sugestões / críticas.

Happy Coding.

OBS: Antes de postar eu notei no esquema de pinagens que no Leornardo o pino SS (17) é o pino A3; então teóricamente é possível utilizar a biblioteca citada sem modificações (basta ligar o pino CS do módulo no pino A3 do Arduino; teóricamente pois eu não testei :)

(Read this post in English)

Aug 2, 2012

Now we are talking :)

Hi

Just a quick update on my Arduino experiments.


Some of my new "toys" just arrived....

I managed to get the following working so far:


  • Ultrasonic sensor (HC-SR04)
  • LCD 16 x 2
  • SD card
  • Temperature sensor (18B20)

Still to go:

  • Ethernet breakout
  • External EEPROM
  • RTC (DS 1307)
  • Nokia 5110 LCD

I am having lots of fun ;)

Lets get back to play with the ethernet breakout. 


See you.

Jul 24, 2012

Arduwhat ?

Hi
Since I was 5 ~ 8 years old I was interested in mechanics, electronics and how things worked in general - my mother has some interesting histories about me disassembling all sort of devices (and usually not being able to put them together again); one in particular in which I got a saw as a "gift" (I was only 6 or 7 and someone gave me a real saw, not a toy, plastic one!) and went to put it into good use sawing some furniture :).

Even though having a high interest in electronics I ended up in the computer software field (just to make it clear: I do enjoy being involved in such fast changing, challenging industry :) and since then I've been having lots of fun (and some frustrations also).
As anyone involved with IT knows, keeping up to date with such a fast changing field requires a lot of effort and over time I put my electronics pretensions to rest (after all there are enough fun stuff in the computer world to play with to keep me busy for a long time...).
But about one year ago this started to change as I started to play with some basic (really basic) electronics stuff again (just for fun) and I stumbled on a small but very interesting piece of hardware: a small board with a microcontroller and a lot of software support with some nice characteristics (at least from my point of view ;) :
  • Open Source Software / Hardware
  • Inexpensive (will not cost you an arm and a leg :)
  • Simple to work with, at least not as complex as the other options I had seem before (no complex, expensive tools required)
  • Easily integrated with the "external" world (through sensors/actuators).
  • Extensible (shields, breakout boards and virtually anything you want)
  • Well supported
  • Large community
which perfectly describes this nice board called "Arduino" (since the name Arduino is trademarked most probably you'll  find compatible devices under some generic brand named with a "duino" suffix).
At this point you may be wondering what can be accomplished with such beautiful piece of hardware... well, I guess it is fair to say that you can find an Arduino C/C++ library for virtually anything you can come up (of course this is not completely true, but it is not too far from the truth). IMO, the important  question is not "is it possible to connect X to Arduino" but instead "how hard is to connect X to Arduino" and based on the list bellow (which I wrote based on information I found) I conclude that, excluding more exotic hardware, it does pretty well job on this topic (note that almost all items in the list bellow requires extra hardware): 
  • Sensors
    • Temperature, Pressure, Gas, Light, Distance, Color, Humidity, Accelerometers, etc.
  • Communications
    • Bluetooth, TCP/IP, UDP/IP, Serial, GPRS, Infrared, etc.
  • Storage
    • EEPROM, SD cards
  • Actuators/Output
    • Step Motors, Servos, DC Motors, LCDs, etc
As you can see it is quite flexible, and more importantly, all of the hardware above have at least one Arduino library ready to be used.

This post is not intended to be an Arduino introduction / course / tutorial. Instead it is meant to be only a teaser so if you want to learn more, you can find lots of information in the internet. Personally there are some sites I highly recommend you to give a visit:

Also, if you want to buy Arduino related hardware you can go to your favorite search engine and search for it and I am sure you'll be able to find lots of stores that sell them. But if you don't want to search, bellow you can find a list of sites in which you can buy Arduino parts (ps: I have no affiliation with any of them :).


Finally, some electronics interesting tools:


Well, that's it. Now let me get back to play with my just arrived Arduino!

In the next post I hope to shed some light about my current projects related to Arduino (both soft and hardware).

Hope you found this post interesting.

Oct 5, 2008

Back to Vista x64

Hi,

Some time ago (sometime around 10/2006) I installed Windows Vista (a release candidate at that time) on my home machine in order to "try" it (to be sincere I've installed various Vista beta/release candidates).

Performance was not impressive but since I'm a software developer (and I didn't used the machine to work anyway) I decided that it worths to be able to experiment with new API / functionality so I kept it.

Some time after that it was released so I got a copy and installed in the same machine.

On 10/2007 I joined db4o and started to work from my home which means that my machine now plays an important role in my development productivity and I decided that I'd rather go with Windows XP (x86 or 32 bits) again (due to the performance impacts I got with Vista x64).

Well, one year passed and I got a new machine (a pretty fast one, lets say) and so I decided to give Vista x64 a try again.

In the first days I do got some BSODs (which made me feel frustrated) but after spending some time searching I found some suggestions regarding memory configurations; after applying such changes (I just set the times after memory manufacturer specifications and increased memory voltage by 0,1 volts) it became stable (no BSOD since them). 


I can say that I'm satisfied up to now; no hardware or software conflicts, performance is pretty good (much faster than my previous machine running Windows XP - I know, XP would run even faster on this machine).

See you.


Adriano

Sep 10, 2008

Here we come again :) - Part III - The end

Well, after some time researching and comparing prices I've ordered my new toy with the following configuration :
ComponentDetail
MotherboardGIGABYTE GA-EP45-DS3R
ProcessorINTEL Core 2 Quad Q3300 2.66GHz 12MB 1.333MHz
Memoty8 Gb - OCZ DDR2 800
CoolerCooler Master Vortex
Power550W - Corsair
KeyboardMicrosoft Wireless Desktop 2000
Video CardGeforce XFX 9600GSO 384MB
HD750GB Samsung
I do hope that this machine can keep up with my needs ;) Also, I ordered a really big
(at least for my standards) monitor .... Now I need to wait more or less one week to put my hands on this and starting installing (probably Windows Vista x64 and some Linux x64 distro also). OMG, I am to anxious! Adriano

Aug 4, 2008

Here we come again :) - Part II

Just a little bit more information on my new toy (the one I am planning to get)
ComponentDetail
MotherboardGIGABYTE GA-EP45-DS3R
ProcessorINTEL Core 2 Quad Q9450 2.66GHz 12MB 1.333MHz
Memoty8 Gb - G.SKILL DDR2 800
CoolerARCTIC COOLING Freezer 7 Pro
Power550W - Seventeam
KeyboardMicrosoft Wireless Desktop 2000 Optico
Video CardGeforce XFX 8600GT 256MB
HD750GB SEAGATE
Even not being the fastest possible configuration it is a pretty good one :) Why did I need such a beast: Well, working as a software developer sometimes I find myself running Eclipse, Visual Studio as well a guest OS within Virtualbox (running VS and some other programs there also ;). So I do believe (I'm not a expert in hardware) that a 4 core processor will be helpful; in the same way, 8 GB of memory doesn't seem that much :) I considered to get a WD Raptor but it's too expansive here; also, I'll install 2 other HDs (that are sitting in my current machine) so I'll get some performance gains due to a more distributed load. Do you have a raid 0 configuration? How does it perform? Is it reliable?
Right now I am considering to build a Raid 0 array also but I'm not sure. My past experience wih Raid 0 was not so good. Adriano

Aug 1, 2008

Here we come again :)

For some time now, my computer started to give me signs that its time is coming. It's a pity since it is only 2 years old and has a not so bad configuration. For me, it's always a dichotomy between a pain and a pleasure when I need to figure out a new configuration. Should I go for a brand computer or should I build it myself? Should I by the latest/fastest/expansive(est) :) processor/memory/whatever (in a useless try to protect my investment) or should I stick to more affordable parts? Please, keep in mind that I live in Brasil and here computers are not so cheap as in some other places. Anyway, just for fun, I am dumping all my previous computer's configuration along side my wishes for the new one:
Year Processor Freq. # Core RAM Hard Disk Graphics Card Internet
1989 6502 0,75 Mhz 1 256 Kb NA OnBoard NA
1992 Ciryx 486 DLC 40 Mhz 1 4 Mb 100 Mb Trident NA
1996 Pentium 100 100 Mhz 1 16 Mb 1.0 Gb ? 28 Kbps
1999 Athlon 400 400 Mhz 1 128 Mb 30 Gb 4 Mb 56 Kbps
2002 Athlon XP 2.1 1.8 Ghz 1 512 Mb 60 Gb AGP 64Mb 350 Kbps
2006 Athlon 64 3.8 X2 2.0 Ghz 2 2.0 Gb 370 Gb PCI-X 256Mb 2.0 Mbps
2008? Core 2 Quad 9XXXX > 2.50 Ghz 4 8.0 Gb 500 Gb PCI-X 256Mb 6.0 Mbps
Well, what can I say? Current PC, RIP :) What do you think? Adriano