Arduino ethernet board compatible with LCD-Display? - arduino

I am doing a little project with an arduino ethernet board. I am new to arduino and wanted to know, whether following lcd display is compatible to my arduino or not. If it is compatible, do I need more hardware, for example cables and so on...
My Arduino Ethernet board, bought on fritzing.org:
http://shop.fritzing.org/products/fritzing-starter-kit-with-arduino-ethernet
LCD-Display which I found on dx.com:
http://dx.com/p/lcd-keypad-shield-for-arduino-duemilanove-lcd-1602-118059
Thanks in advance for any help!

In the ethernet board, pins 10-13 are reserved. The lcd-shield is using pins 4-10 (although #10 is the backlit control, so it may be possible to go without it, just having a constant backlit) - I have the lcd - keypad shield, but at home, so I cannot check that now. - look into the lcd-library to see if you can somehow define it.
That is, it is not possible to use the backlight and the ethernet at the same time. For your other question, you just stack the LCD -keypad shield on top of your arduino board, no other connections or cables are needed.
Although it may look a bit more scary, a display without a shield, eg http://dx.com/p/16-x-2-character-lcd-display-module-with-blue-backlight-121356 is not much harder to set up and it gives you more flexibility. (although, for the display I linked to, you must be able to solder in a set of pins to connect it) Another alternative is http://dx.com/p/16-x-2-character-lcd-display-module-with-blue-backlight-121356 - the latter gives you more flexibility, but poorer readability and it is a bit more work to set up the library.

Related

Putting my raspberry pi program on a more primitive chip

I recently started coding on a raspberry pi. I build a circuit with three buttons, an LED and a 7 digit LCD. Its a fairly simply thing. You can set a time value with the + and - button in seconds and then press the other one to start a countdown. I use this to do triggered long exposures with my camera. However the raspberry pi is to big and bulky and needs to much energy.
Then I put my code and my circuit on an Arduino UNO which is an improvement in size and energy consumption.
Because my program is very simple I am sure that there must be a way to get this on a much smaller chip. I need some kind of programmable chip where I can put my code onto. Something that is small and dont has any other fancy features or more calculating power than I could need. As far as my knowledge goes I dont have any idea how to get into that.
At work we have a 3D printer with a W1209 temperature relay controller on it. This is a small circuit with the same 7 digit LCD pane and the temperature is also settable with two buttons. This inspired me to look for something much more primitive that would be enough for my needs.
Can you recommend any hardware or some tutorials about that?
Search the Microchip website for the DM164141 - MPLABXpress PIC16F18345 Evaluation Board. I think it's around $12 and should have enough I/O for your application. You can use the online MPLABXpress IDE for development.

Why do we need to select a board to work with arduino IDE

I always wondered how this works . In arduino IDE we have option to select different boards because the code upload i guess is different ? Also there is possibility to even add board manager url to add other boards.
Why uploading the code is so different from board to board , and what exactly differs there ? The code is sent to via serial connection and i understand that a board might have different chip for handling USB to serial but ..
Can someone explain as clear as possible , how the code is uploaded to a board and why there is no generic way , why so many configurations.
Thanks and sorry if is a dumb question.
One of the important things that selecting a board does is, as you say, inform the IDE of how to load code onto the board. Perhaps more importantly, the board definitions give you the logical mapping of the board's hardware to the code constructs you are using to program against. For example, have you ever wondered what happens when you use a constant like PIN_13, or how that constant maps to a physical pin on your board, which has a trace to some contact on the microcontroller chip itself?
There is a lot of other code you don't see, much of it in the board definitions (and some in the Arduino core) which lets you work with relatively direct concepts (like pin numbers and modes) in the code that you write or edit.

Running encoder on Arduino Mega using Simulink

I am using Simulink togheter with an Arduino Mega 2560 to control a motor with encoder. The encoder has 200 steps per revolution. My aim is to use external mode in order to get out data into the Simulink scope.
Earlier, when not using the Simulink blocks, this worked fine using attachInterupt. Now it does not work since Simulink does not have that option. I have tried two methods:
use the digital input blocks and trigger > too slow
use the serial block togheter with an extra arduino (uno) that Only handles the encoder signal (this extra arduino is not programmed in Simulink) and sends the pulses to the main arduino (the baudrate does not seem to the limiting factor, instead it is the fact that the block only handles uint8) > also too slow
I cannot see the generated code in my Simulink license, and I would prefer a solution where blocks are used. Is there a work-around??
Any tip is appreciated!
you may use S-function to develop encoder algorithm using the attachinterrupt of arduino. this link may help http://www.mathworks.com/matlabcentral/fileexchange/39354-device-drivers
Update: You can use the External Interrupt block to implement this in the latest version of the support package.

Joystick USB definition for use with Arduino

I'm trying to write the control code for a custom joystick, and I cannot find any reference to what needs to be implemented to be recognized by a computer as a joystick.
I can see what things I need to have by referencing various game library APIs for using a joystick.
For example, pygame has the following methods,
init
quit
get_init
get_name
get_id
get_numaxes
get_numbuttons
etc.
My next stop is to read through the kernel for Linux's HID and joystick controlers... But this seems like a really round about way of finding this information.
I haven't worked with it, but it looks like there is some interesting information in Arduino Uno Joystick HID firmware and Arduino Uno Big Joystick HID firmware. There is also UnoJoy - I'd try that first (assuming you have an Arduino Uno or Leonardo).

Communicating with the Pic 16F913

Here is my issue, it appears that all the communication lines for the PIC 16F913 reside on the same set of pins, this is convenient in that I don't have to sacrifice GPIO pins just to do comms, however the problem I'm having now is if I'm using the SPI on the chip, how can I send information to the RS232?
The reason this issue came up, is that I just bought a CAN bus chip that communicates over SPI, and I would really like to see the data on RS232, so I can see messages. (I really don't know much about CAN yet, so who knows if this even makes sense yet).
Here are the options I see, and maybe someone else has better ideas that I'm just simply missing.
Somehow setup a time scheme that will switch between SPI and RS232 every time I get data,
-- This doesn't seem hard and should work, but supposing I don't want to miss a message, what if a message is written while I'm writing to RS232, is it possible I'll miss it?
2.. I can always use SPI, but then build my own comm bus over 8 of the GPIO lines, to another PIC 16F913, using only the GPIO lines and then since the RS232 lines are free on the second PIC I can simply read the data and spit it out.
-- This one is doable but now we're wasting 2 chips, AND all the GPIO lines,
There has to be a better way. Or is there?
Any help is greatly appreciated.
Update: I would like to clarify, obviously one solution is using a completely different chip (which may in fact be what I end up doing, if I can get the 18F programmed), however, I'm interested in worst case scenario, in which I am limited in resources and only have some 913's, is the way described above the only way to do it with this chip, or is there a better way?
You could do a software implementation of the SPI bus - it's easier to do than the UART because the timing isn't critical and you are in control of it.
Most CAN chips have a few receive buffers so if you're busy doing something with the UART then the messages will be buffered inside the CAN chip. But... you will need to make sure that you can get the messages out of the CAN chip fast/often enough so you don't lose some.
You would probably have to either use an interrupt for the UART Tx process - so that you can be receiving CAN messages while you're sending data on the UART.
If you're only interested in certain messages most CAN chips have filters - this makes it easy to only receive the messages you're interested in, usually dropping the number of packets/second dramatically.
You can use a software implementation of a RS232 port. For example the c compiler from http://mikroe.com comes with such a library. But it shouldn't be too hard to shift bits to an output pin, rs232 is a fairly simple protocol.
I strongly recommend that you change the MCU with PIC16F1933.
It is newer
It is cheaper
With EUART and MSSP moduls.
The MCU arhitecture is impruved.
The PIC16F913 MCU will become obsolete in next few years!

Resources