RS485 interface in C [closed] - c

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 21 days ago.
Improve this question
I would like to access a reader from my Raspberry PI. It is connected to my Raspberry PI via an Ethernet cable and has an RS485 interface.
Can anyone help me accomplish this task and suggest me steps to establish communication between the devices?
I searched for answers to this problem and I expect some information.

It is connected to my Raspberry PI via an Ethernet cable and has an
RS485 interface.
Do not connect RS485 to the Ethernet port of your PI. You may fry the port.
To use the RS-485 interface with your PI you need RS-485 hat (addon card) which has RS485 transceiver:
https://thepihut.com/products/rs422-rs485-serial-hat

Related

C - detect when an external circuit is closed (button push) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am trying to find out if there is a way for a C console program to detect when an external circuit is closed (e.g. a button is pushed). I have searched for code examples or insight but with no luck.
I know this is easy in arduino/raspberry pi etc. but this will be part of a C console program running on windows.
Ideally the button/switch will be connected by USB or serial.
My current thoughts are to make the switch part of a HID and have it act as a keystroke but this is not my preference.
My preference would be to just close the circuit (short the usb) and have some code that registers when a usb or serial port has a voltage applied but I am not sure if that is possible.
Thank you for your help.
There are several ways of doing this, although you still need external hardware (for example, Arduino).
Via UART - With every Arduino you can communicate via UART/Serial. You will need send data from Arduino to PC when button state changes, and then listen for this data in your C app on computer.
Via HID - For example, Arduino Leonardo (and all other Arduinos with ATmega32U4) have USB Host feature, so you can create your own HID and send data this way, or directly via USB (without HID usage).
15pol game port and 25pol parallel port are able to detect/switch signals, inputs and outputs.
The 15pol game port would be most easy to use, if you still have some.

I need information about writing a device driver for microcontroller [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
i am bit confused between device driver and source code. what is the necessity of device driver.for eg. suppose i want to interface LPC2148 to LCD so do i need to develop driver for it?? or i need to write only a source code.
When it is required to write device driver for microcontroller.
and what is meant by linux device driver? do i need to port linux kernel in microcontroller?
is there any resource on internet, or any book from which i can learn these all things?
Thank you friends.
Source code and device driver are two different things..
device drivers required for controlling the device ...in case of micro-controller device drivers are used for accessing registers, bit wise functionality and ports in general...
source code can be for any software -written in low or high level language.
on the question of device driver-- many times driver is provided in linux or available from device manufacturer...u don't need to write device driver unless u r a developer or making a project...
there are many resources available on the internet for interfacing any micro-controller with lcd...just google it..
hope this helps...
cheers and regards dip-ak

Make device driver for parallel port DB25 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I am beginner in device driver. i can make simple character device driver with simple apis (eg. open,close,read,write). so i have basic knowledge of char device driver. and i want to make driver for Parallel port DB25.
Chapter 9 of the Linux Device Drivers book [1] has concrete examples for hardware control and I/O. It also covers implementing a simple parallel port driver. Later chapters cover interrupts, DMA, and PCI devices, which would be a good next step afterward.
[1] Linux Device Drivers -- Chapter 9: Communicating with Hardware
http://lwn.net/Kernel/LDD3/
Linux already has a driver for the parallel port; it's called parport, and you can find it here:
https://github.com/torvalds/linux/tree/master/drivers/parport
Note that parport isn't a character device on its own. That's handled by lp:
https://github.com/torvalds/linux/blob/master/drivers/char/lp.c

AT91SAM7X-EK Evaluation Board [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I just recentely started working with a new board: a AT91SAM7X-EK. I would like to get more information about the board's processor (AT91SAM7X256) and the board's flash. So I looked at a pretty detailed data sheet and a summary of the data sheet, but have been unsucessfull (so far) of finding the information I want. I would appreciate if anyone could help me on the following aspects of the board:
How do I connect to the board? Is it through ssh? If so, how is it possible to recuperate the board's IP address. I have an ethernet cable for the connection.
How do I load an application onto the board's flash? For example, I would like to cross compile (using a toolchain I've already installed - arm-none-eabi) a simple hello world program in C to load onto my board. How would I go about doing so?
I would appreciate any help on this issue.
The board is supplied "bare-metal" - no code, no OS. You will not be able to run Linux on an AT91SAM7X-EK - it has insufficient memory resources and rins at 30MHz tops (and has no MMU).
You need a hardware JTAG or DBGU interface device and a tool-chain that will work with it.
You should probably also be looking at the datasheet for the board itself. From the Getting Started section of that:
The AT91SAM7X-EK evaluation board is delivered with a DVD-ROM containing all necessary
information and step-by-step procedures for working with the most common
development tool chains. Please refer to this DVD-ROM, or to the AT91 web site,
http://www.atmel.com/products/AT91/, for the most up-to-date information on getting
started with the evaluation kit.
So start there.

How to install Arch linux on pandaboard [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Im having problems with the installation.
I tried this already , http://archlinuxarm.org/platforms/armv7/ti/pandaboard i don't know if im doing it correctly because when i connect it to the HDMI and the tv, nothing seems to work.
I recently got the same problem with my pandaboard ES. I can't say I have everything working now, but you can have a feedback of the boot with the DB9-RS232 port. You'll probably need to use an adaptator DB9/USB to open a serial connection at 115200 baud with the card (you can use the screen program to do so).

Resources