Jump to content
Electronics-Lab.com Community

All Activity

This stream auto-updates

  1. Past hour
  2. Today
  3. Good Profile Backlinks

    Good Backlinks Profile

    Get Fast Result and High Ranking for your Website by Using Good Profiles Backlink Service with us.

  4. This article will introduce the method to implement USBNET mode using the Forlinx Embedded OK3568-C development board. Before that,we need to know what is USB Gadget.USB Gadget refers to an electronic device that is developed to connect to a host via USB in USB peripheral mode. For example, when a mobile phone is plugged into a PC through a USB cable, the mobile phone is a USB Gadget. Similarly, in the article, the mobile phone is replaced by the OK3568-C development board. The Gadget framework provides a set of standard APIs at the bottom layer,and the USB Device Controller (UDC) driver implements this set of APIs. Different UDC (usually part of the SoC) requires different drivers, and even different boards based on the same UDC need to modify the code. If we want to implement USBNET, we also need a driver, which is called RNDIS. The RNDIS driver is present in the kernel, you just need to find the configuration entry and compile it into the kernel. First go to the source kernel directory and enter the menuconfig graphical configuration screen: When entering menuconfig, you need to specify the environment.Otherwise the graphical configuration interface entered by executing make menuconfig directly is for the X86. As shown in the figure below, the ARM architecture is the correct graphical configuration interface: Press/to enter the search interface: Directly search for rndis and find the directory with the word "USB Gadget". You can see that there are multiple paths. You can directly enter the USB Gadget directory to see that it is the option to configure RNDIS. After searching, the final path is shown as follows: Turn on the RNDIS driver and select some network protocol configurations, as shown in the circle below: Find the USB Gadget precomposed configurations and compile RNDIS into the kernel (if you choose to compile it into a module, compiling the kernel alone will not generate a.ko file. In order to save the tedious mounting steps, this article compiles RNDIS into the kernel). After the configuration is completed, press the Exit key to exit, and select yes for "Save or not": Return to the source code directory to enter the build. Sh script, and comment out the defconfig command to generate the.config file, so that the menuconfig configuration takes effect. The comment location is as follows: Save and exit, compile the kernel separately, and execute the./build. Sh kernel under the source code directory. After compilation, boot. IMG files are generated in the kernel directory. Use RKDevTool, the burning tool provided by Rockchip, to update the image in a single step. Press and hold the Recovery key and press Reset until the programming tool displays that a LOADER device has been found and then release the Recovery key. Replace the position in the figure, click the device partition table, and then click Execute. After the device restarts, the burning is completed, and there will be burning progress on the right side. After the development board restarts, ifconfig -a shows that the usb0 node is generated. Some of the more interesting features can be achieved with the Linux USB Gadget device driver: 1. A certain storage device in an embedded product, or a certain partition of a storage device, can be recognized by a PC as a U disk; 2. After an embedded device is connected to the PC through USB, a new network connection will appear on the PC side. There will also be a network card device on the embedded device. You can configure their IP addresses and conduct network communication, commonly known as USBNET. The USB 3.0 interface is used this time, so it is necessary to use“detect”to activate Type-C 5V to 3.3 V Type-A, and the hardware is changed to connect pin1 of p40 to the positive pole of C23. Set the dip switch to ON,and insert the dual-male USB cable; Force USB output to device echo peripheral > /sys/devices/platform/fe8a0000.usb2-phy/otg_mode The print information is shown as follows: This node can be seen on the device manager network adapter to configure an IP Check the network connection you can see an unrecognized network, configure this also with IP. Note that it needs to be in the same network segment as the IP configured on the OK3568-C development board: Use the OK3568-C development board to ping the IP configured by the computer just now, and find that it can be pinged. We can see that OK3568-C development board has realized USBNET function and network sharing. Originally published at www.forlinx.net.
  5. Yesterday
  6. Have you watched the movie 'Project Almanac'? Which was released in the year 2015. If not, then let me brief you a scene about it. In the movie, the main character wishes to get into MIT and therefore, builds a project for his portfolio. The project was about a drone, that could be controlled using a 2.4GHz remote controller, but when the software application on the laptop was run, the main character was seen controlling the drone with his hands in the air! The software application used a webcam to track the the movement of the character's hand movements. Custom PCB on your Way! Modern methods of development got easier with software services. For hardware services, we have limited options. Hence PCBWay gives the opportunity to get custom PCB manufactured for hobby projects as well as sample pieces, in very little delivery time Get a discount on the first order of 10 PCB Boards. Now, PCBWay also offers end-to-end options for our products including hardware enclosures. So, if you design PCBs, get them printed in a few steps! Getting Started As we already saw, this technology was well displayed in the movie scene. And the best part is, in 2023 it is super easy to rebuild it with great tools like OpenCV and MediaPipe. We will control a machine but with a small change in the method, than the one the character uses to let the camera scan his fingers. He used color blob stickers on his fingertips so that the camera could detect those blobs. When there was a movement in the hands, which was visible from the camera, the laptop sent the signal to the drone to move accordingly. This allowed him to control the drone without any physical console. Using the latest technological upgrades, we shall make a similar, but much simpler version, which can run on any embedded Linux system, making it portable even for an Android system. Using OpenCV and MediaPipe, let us see how we can control our 2wheeled battery-operated car, over a Wi-Fi network with our hands in the air! OpenCV and MediaPipe OpenCV is an open-source computer vision library primarily designed for image and video analysis. It provides a rich set of tools and functions that enable computers to process and understand visual data. Here are some technical aspects. Image Processing: OpenCV offers a wide range of fuctions for image processing tasks such as filtering, enhancing, and manipulating images. It can perform operations like blurring, sharpening, and edge detection. Object Detection: OpenCV includes pre-trained models for object detection, allowing it to identify and locate objects within images or video streams. Techniques like Haar cascades and deep learning-based models are available. Feature Extraction: It can extract features from images, such as keypoints and descriptors, which are useful for tasks like image matching and recognition. Video Analysis: OpenCV enables video analysis, including motion tracking, background subtraction, and optical flow. MediaPipe is an open-source framework developed by Google that provides tools and building blocks for building various types of real-time multimedia applications, particularly those related to computer vision and machine learning. It's designed to make it easier for developers to create applications that can process and understand video and camera inputs. Here's a breakdown of what MediaPipe does: Real-Time Processing: MediaPipe specializes in processing video and camera feeds in real-time. It's capable of handling live video streams from sources like webcams and mobile cameras. Cross-Platform: MediaPipe is designed to work across different platforms, including desktop, mobile, and embedded devices. This makes it versatile and suitable for a wide range of applications. Machine Learning Integration: MediaPipe seamlessly integrates with machine learning models, including TensorFlow Lite, which allows developers to incorporate deep learning capabilities into their applications. For example, you can use it to build applications that recognize gestures, detect facial expressions, or estimate the body's pose. Efficient and Optimized: MediaPipe is optimized for performance, making it suitable for real-time applications on resource-constrained devices. It takes advantage of hardware acceleration, such as GPU processing, to ensure smooth and efficient video processing. From above if you have noticed, this project will require one feature from each of these tools, to be able to make our project work. Video Analysis from OpenCV and HandTracking from MediaPipe. Let us begin with the environment to be able to work seamlessly. Below is the complete architecture of this project - Hand Tracking and Camera Frame UI As we move ahead, we need to know how to use OpenCV and Mediapipe to detect hands. For this part, we shall use the Python library. Make sure you have Python installed on the laptop, and please run below command to install the necessary libraries - Run the command to install the libraries - python -m pip install opencv-python mediapipe requests numpy To begin with the the control of car from the camera, let us understand how it will function - The camera must track the hands or fingers to control the movement of the car. We shall track the index finger on the camera for that. Based on the location of finger with reference to the given frame, there will be forward, backward, left, right and stop motion for the robot to function. While all the movements are tracked on real time, the interface program should send data while reading asynchronously. To perform the above task in simple steps, methods used in the program have been simplified in beginner's level. Below is the final version! As we see above, the interface is very simple and easy to use. Just move your index finger tip around, and use the frame as a console to control the robot. Read till the end and build along to watch it in action! Code - Software Now that we know what the software UI would look like, let us begin to understand the UI and use HTTP request to send signal to the car to make actions accordingly. Initializing MediaPipe Hands mp_hands = mp.solutions.hands hands = mp_hands.Hands() mp_drawing = mp.solutions.drawing_utils Here, we initialize the MediaPipe Hands module for hand tracking. We create instances of mp.solutions.hands and mp.solutions.drawing_utils, which provide functions for hand detection and visualization. Initializing Variables tracking = False hand_y = 0 hand_x = 0 prev_dir = "" URL = "http://projectalmanac.local/" In this step, we initialize several variables that will be used to keep track of hand-related information and the previous direction. A URL is defined to send HTTP requests to the hardware code of ca Defining a Function to Send HTTP Requests def send(link): try: response = requests.get(link) print("Response ->", response) except Exception as e: print(f"Error sending HTTP request: {e}") This step defines a function named send that takes a link as an argument and sends an HTTP GET request to the specified URL. It prints the response or an error message if the request fails. These are the initial setup steps. The following steps are part of the main loop where video frames are processed for hand tracking and gesture recognition. I'll explain these steps one by one: MediaPipe Hands Processing ret, frame = cap.read() frame = cv2.flip(frame, 1) rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB) results = hands.process(rgb_frame) Inside the loop, it captures a frame from the camera (cap.read()) and flips it horizontally (cv2.flip) to mirror the image. The code converts the captured frame to RGB format (cv2.cvtColor) and then uses the MediaPipe Hands module to process the frame (hands.process) for hand landmark detection. The results are stored in the results variable. Hand Landmarks and Tracking if results.multi_hand_landmarks: hand_landmarks = results.multi_hand_landmarks[0] index_finger_tip = hand_landmarks.landmark[mp_hands.HandLandmark.INDEX_FINGER_TIP] hand_y = int(index_finger_tip.y * height) hand_x = int(index_finger_tip.x * width) tracking = True This section checks if hand landmarks are detected in the frame (results.multi_hand_landmarks). If so, it assumes there's only one hand in the frame and extracts the y-coordinate of the index finger tip. It updates hand_y and hand_x with the calculated coordinates and sets tracking to True. Direction Calculation frame_center = (width // 2, height // 2) if trackin direction = find_direction(frame, hand_y, hand_x, frame_center) if(direction != prev_dir): try: link = URL+direction http_thread = threading.Thread(target=send, args=(link,)) http_thread.start() except Exception as e: print(e) prev_dir = direction print(direction) In this step, the code calculates the center of the frame and, if tracking is active, it uses the find_direction function to calculate the direction based on the hand's position. The direction is stored in the direction variable. We used current direction and previous direction variables. It helps in keeping a semaphore of sending only one HTTP request for every change in command. Then overall store it in a single URL to send the HTTP request. Visualization opacity = 0.8 cv2.addWeighted(black_background, opacity, frame, 1 - opacity, 0, frame) cv2.imshow("Project Almanac", frame) If tracking is active, this section of the code adds visual elements to the frame, including a filled circle representing the index finger tip's position and text indicating the detected direction. The code blends a black background with the original frame to create an overlay with adjusted opacity. The resulting frame is displayed in a window named "Project Almanac". Code - Hardware Now that we are done with the software side code, let us look into the software side code - Importing Libraries: #include <WiFi.h> #include <ESPmDNS.h> #include <WebServer.h> In this section, the code includes necessary libraries for WiFi communication (WiFi.h), setting up mDNS (ESPmDNS) for local network naming, and creating a web server using the WebServer library. Defining Pin Constants: int LeftA = 33; // IN1 int LeftB = 25; // IN2 int RightA = 26; // IN3 int RightB = 27; // IN4 Here, the code defines constants for pin numbers corresponding to motor control pins (presumably for a robotic project). These pins will control the movement of motors. Setting Up Wi-Fi Credentials: const char* ssid = " "; // Enter SSID here const char* password = " "; // Enter Password here You need to fill in your Wi-Fi network's SSID and password here to connect the ESP8266 device to your local Wi-Fi network. Configuring Motor Control Pins: pinMode(LeftA, OUTPUT); pinMode(LeftB, OUTPUT); pinMode(RightA, OUTPUT); pinMode(RightB, OUTPUT); pinMode(2, OUTPUT); In this part, the code sets the motor control pins (LeftA, LeftB, RightA, RightB) as OUTPUT pins, presumably to control motors for a robotic project. It also sets pin 2 as an OUTPUT, possibly for controlling an indicator LED. Connecting to Wi-Fi: Serial.begin(115200); delay(100); Serial.println("Connecting to "); Serial.println(ssid); // Connect to your local Wi-Fi network WiFi.begin(ssid, password); // Check if the device is connected to the Wi-Fi network while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.print("."); } // Display connection status and IP address Serial.println(""); Serial.println("WiFi connected..!"); Serial.print("Got IP: "); Serial.println(WiFi.localIP()); digitalWrite(2, HIGH); // Turn on a blue LED to indicate a connected WiFi This part of the code initiates a connection to the specified Wi-Fi network using the provided SSID and password. It waits until the device successfully connects to the Wi-Fi network and then displays the IP address. Additionally, it turns on an LED on pin 2 to indicate a successful connection. Setting up mDNS (Multicast DNS): if (!MDNS.begin("projectalmanac")) { Serial.println("Error setting up MDNS responder!"); while(1) { delay(1000); } } Serial.println("mDNS responder started"); Here, the code sets up mDNS with the hostname "projectalmanac." This allows the device to be reachable on the local network using the hostname instead of an IP address. Defining HTTP Server Endpoints: server.on("/", handle_OnConnect); server.on("/left", left); server.on("/right", right); server.on("/forward", forward); server.on("/backward", backward); server.on("/stop", halt); server.onNotFound(handle_NotFound); This part defines different HTTP server endpoints that can be accessed via URLs. For example, "/left" will trigger the left function when accessed. Starting the Web Server: server.begin(); Serial.println("HTTP server started"); MDNS.addService("http", "tcp", 80); } The code starts the web server, making it available for handling HTTP requests on port 80. It also registers the HTTP service with mDNS. Handling Client Requests: void loop() { server.handleClient(); } In the loop function, the server continuously handles client requests, responding to various endpoints defined earlier. HTTP Request Handling Functions:The code defines several functions (forward, backward, left, right, halt, handle_OnConnect, handle_NotFound) that are called when specific endpoints are accessed. These functions are responsible for controlling motors and responding to client requests. The HTML page provides information about available commands and instructions for interacting with the device. Project Almanac in action! Now that we have understood the code sequence, let us see the work! We can further add more features if you'd like to. Rest, the UI is simple enough to handle, which comes with not many features, but important one's. cameracontroller_on_python.py carfirmware.cpp
  7. Last week
  8. Thanks for the detailed discussion of the project. Here somebody designed a smaller alternative https://www.pcbway.com/project/shareproject/Atiny_85_crypto_miner_9415f34a.html It is based on Attiny85.
  9. Perhaps a voltage comparator? See: Comparator You could use the 12 volts to trigger a relay that supplies a voltage to the timer? The relay should require more than 10 volts to trigger the relay to avoid the rewind? It is not clear where the 0.0009 volt and 0.1 volt signal comes from.
  10. I have a DC 12v circuit using Eagle Timer A103-006 - Eagle Signal - Panel Mount Timer, Elapsed Time Indicators, 115 VAC (newark.com) I was going to use the OUT/unwind signal to the winch as my trigger to begin the Eagle timer counting. I timed 1 revolution equals 1 ft of rope release. I plan to use the timer to count how many feet I have out. Therefore, when off I should have 0 volts. To my dismay there is actually 0.0009 Volt DC and this is enough to start A103-006 to start counting....ugh don't want it too! When I operate the winch OUT/unwind position, I measure 0.100V DC. When the winch operates IN/wind-up position, I measure 10+ V DC. I learned of zener diode. I am not sure this will help with such a low voltage. Where can I obtain a component that only allows 0.1 volt signal to pass through so Eagle timer can be used? Please advise of my options. thank you
  11. Thank you for sharing this post. It is very useful for me.
  12. It’s almost Valentine Day. This year, instead of giving her a rose bouquet, I wanted to express my love by gifting her an electronic breathing heart.
  13. Robots can be broadly divided into three categories: industrial robots, service robots, and special robots. Although the market size of special robots is relatively smaller than the other two, with the accelerated evolution of new technological and industrial transformations, the deep integration of 5G, artificial intelligence, and robotics technology has expanded the application scenarios for special robots. They are increasingly playing a crucial role in various industries. This article will introduce a special robot, namely intelligent inspection robot, whose function is to replace manual inspection and maintenance of equipment. Additionally, we will explore the main functions of the intelligent inspection robot and introduce the FET3588J-C SoM recommended by Forlinx Embedded as the main control platform for the robot. In the process of rapid urban development, more and more pipelines are laid underground. How to maintain such a large area of underground pipe gallery quickly and accurately? Considering the complex and potentially hazardous environment of underground tunnels, the underground space intelligent inspection robot emerges. Intelligent robot inspection and monitoring systems, as well as disposal systems, can be installed in underground tunnels to construct a smart operation and maintenance software platform. This platform enables regular detection and monitoring of the basic attributes within the space, ensuring the normal operation of the facilities. Intelligent inspection robots are generally divided into three main parts: the robot operation, the IoT sensing, and the application. They are respectively used for “ensuring the normal operation of the robot,” “perceiving the underground space,” and “processing and responding to the data collected by the IoT sensing part.” (1) Real-time Detection and Environmental Monitoring The robotic system can monitor the site environment in real-time through the high-definition camera. It can collect information such as humidity, temperature, and harmful gas concentration at the equipment site through external temperature and humidity sensors, which is then uploaded to the cloud via 4G or 5G. (2) Fully Automatic Inspection According to its own time settings or remote control from the cloud, the inspection robot can perform routine tasks and specialized training inspections through real-time GPS and 5G positioning of its location. (3) Automatic Charging and Automatic Return at Low Power It can independently judge the state of battery power, automatically return when the battery power is insufficient, and cooperate with the charging equipment to complete the autonomous charging; (4) Autonomous Obstacle Avoidance Function During the monitoring process, the robot incorporates NPU machine vision to recognize and differentiate track obstacles and pipeline obstacles from the camera-collected data. It can immediately stop and upload alarm information. (5) Automatic Generation of Inspection and Monitoring Reports It organizes the information collected from this inspection and produces an inspection and monitoring report of the site status after CPU simplified processing to visualize the site data. Forlinx Embedded has launched the FET3588J-C core board as the main control platform for this intelligent inspection robot product to meet customers' needs for machine vision and high-speed interfaces. The FET3588J-C is developed and designed based on the Rockchip RK3588 processor. It features quad-core Cortex A76+quad-core Cortex-A55 architecture, with the main frequency of A76 core up to 2.4 GHz, and the main frequency of A55 core up to 1.8 GHz, which enables efficient processing of the collected information from inspections. Built-in Rockchip self-developed three-core NPU can work cooperatively or independently, so as to flexibly allocate computing power and avoid redundancy. The comprehensive computing power can reach 6 TOPS, which greatly improves the computing speed and energy efficiency ratio of neural network, and can better realize the function of active obstacle avoidance; The RK3588J supports 48 million pixels ISP 3.0, which enables lens shading correction, 2D/3D noise reduction, sharpening and defogging, fisheye correction, gamma correction, wide dynamic contrast enhancement, and other effects that greatly enhance image quality. It also offers high stability and can operate for long periods in harsh industrial environments ranging from -40°C to +85°C, making it suitable for applications in various scenarios. In addition, it also supports Linux 5.10, 66/Android 12 high-version and high-stability operating system, with more perfect driver and open system source code, so that customers can quickly enter the product testing stage. Originally published at www.forlinx.net.
  14. Yeah, amplification is definitely possible, I've done it myself.
  15. Professional electronic components supplier! https://www.htelec.net has tens of millions of models available! Welcome to cooperate! HT ELECTRONICS (HK) Co.,LIMITED was founded in 2006. The company has more than 60 employees, including 2 overseas returnees, MBA2, and more than 50 college students, occupying 400 square meters of senior office, including: international, domestic sales, procurement, enterprise planning, technology, customer service, etc; The annual sales volume of Huantong is more than 80 million, and the average annual sales volume is expected to exceed 100 million in the future; The company's customers are distributed in major cities in Europe, America and Asia. HT ELECTRONICS follows two development lines of agency and independent distribution, and the whole line of agency of Intel, Altera, and Xillinx brands; It has a mature sales and procurement team, a strict quality management system and a stock of major IC brands in the world, and has established procurement centers and export centers in many countries and cities in the world. Advantage brands: Intel, Altera, Xillinx, AD, ST, TI, Microchips, NXP, Infinion, Cypress, Maxim, TDK, MURATA, AVX, MOLEX, TE, Samtec, Phoenix, Weidmuler.....
  16. I have a simple wifi question. I have an outdoor IP security camera and it is connected to one of my WiFi access points for ease of use and convenience. It is working well except that the wifi link is not optimum. It gets disconnected sometimes although this wasn't a problem before but it is now and I don't know why the link deteriorated. Anyways, I want to improve this link by using a directional wifi antenna. So, is it just a matter of getting a directional yagi like antenna with a good gain--instead of the regular omni-directional one -- and point it toward the access point and be done with it? Or is it more involved?
  17. Thanks a lot! Writing is a very difficult task for me. I turned to nurse writing services when I needed to submit essays and lab work. I was pleased because I found specialists who work with medical topics. This is very rare nowadays. And now I have time for hobbies and reading books.
  18. Introduction: Maxim Semiconductor is the Chinese name of Maxim Integrated, a semiconductor manufacturing supplier founded in 1983. The company is headquartered in California, USA. In 2001, Maxim acquired Dallas Semiconductor. Maxim's mission is to provide innovative analog and mixed-signal solutions that add value to our customers' products. The company has established branches in Europe, Asia, and the United States, and has three offices in China: Beijing, Shanghai, and Shenzhen. Introduction Maxim Semiconductor's MAX14745EVKIT evaluation kit is designed to evaluate the operation of the MAX14745 wearable device charging management solution with I2C functionality for low-power wearable applications. The kit uses a proven PCB layout and I2C serial interface. The MAX14745EVKIT evaluation kit is fully assembled, tested, and compliant with RoHS directives. Characteristic Comply with RoHS directive Proven PCB layout Application fitness monitor Rechargeable IoT device wearable electronics Maxim Semiconductor not only facilitates design through analog integration, but also speeds up time to market. The company's analog ICs provide additional features and functionality designed to simplify circuitry and design. Maxim provides solutions for the following products: consumer electronics, personal computers and peripherals, mobile devices, wireless and fiber optic communications, test equipment, instrumentation, video displays, automotive applications, etc. Maxim's analog and mixed-signal solutions include data converters, interface circuits, RF wireless circuits, clocks and oscillators, microcontrollers (MCUs), operational amplifiers, sensors and more.
  19. Hello everyone, I have a network coverage challenge and would like some guidance. I have two houses about 15 meters apart and don't consider running cables to connect them. Here are my questions: Room 1: This house has a router that connects to the internet via fiber optic cable. The router provides Wi-Fi signal coverage, but the range is limited. Room 2: There is no GSM network coverage in this house, so I need to provide Wi-Fi signal so that users can use Wi-Fi calling. House No. 2 is approximately 15 meters away from House No. 1 and there is no physical barrier. My plan is to install a signal amplifier in house #2 that will receive the Wi-Fi signal from the router in house #1 and then spread this signal throughout house #2. My question is, is this possible with a directional antenna? If so, what kind of antenna should I use? What factors do I need to consider to ensure a stable signal between two houses?
  20. You can have any of them, really.
  21. Earlier
  22. QuickBooks File Doctor+1-844-476-5438 is designed to assist users of accounting software in identifying and resolving different problems with their business files. Many companies use the popular accounting program QuickBooks to manage their finances, but occasionally these company files may encounter technological issues that render them unusable. The QuickBooks File Doctor is designed to solve these problems by identifying and fixing file-related errors. Its primary characteristics and skills are succinctly described as follows: keep a diagnostic log. QuickBooks File Doctor scans corporate files for errors including data corruption, network issues, and other file-related issues. The integrity of the file is found to be at risk, and the issue is reported. network difficulties There may be several users and computers connected to the network when you use QuickBooks.problem setup. You can help maintain good user-to-user communication by using QuickBooks File Doctor to find and, if possible, resolve certain network-related problems. Fixing files The program occasionally tries to automatically fix particular kinds of file corruption. Small issues could be resolved by it on its own. Data conversion: QuickBooks File Doctor can help you move your company file from an outdated version of QuickBooks to a more recent one. It aids in software upgrades. Re-establishing the connection will assist if you're having trouble accessing your corporate file, particularly if you're utilizing a multi-user setup. Good advice: On how to avoid future file-related problems, the source offers advice and suggestions

    Ingoude Company.jpg

  23. Advantage brands: Intel, Altera, Xillinx, AD, ST, TI, Microchips, NXP, Infinion, Cypress, Maxim, TDK, MURATA, AVX, MOLEX, TE, Samtec, Phoenix, Weidmuler.

  24. Sounds very interesting! Please be aware that working with radio signals and FM transmitters may require some knowledge of electronics and radio engineering and may involve legal restrictions. It is always important to comply with local laws and standards when creating such devices.
  25. The Forlinx OKMX8MP-C development board is equipped with two native CAN buses. However, in certain product development scenarios, there is a need for additional CAN buses. This article will introduce a method for SPI to CAN conversion, providing engineers with a reference. Description • The FETMX8MP-C SoM has two native SPI buses. Currently, the pins of SPI1 are being used for LED and UART3 functions, while SPI2 is configured as a normal SPI2 interface. Taking SPI2 to CAN conversion as an example, the process involves porting the SPI to CAN chip; • The model of the SPI to CAN chip is MCP2518. This chip is capable of converting to CAN-FD. If only CAN functionality is required, you can refer to this method for porting MCP2515 or other chips; • The driver for the MCP2518 chip in this porting process is sourced from the i.MX8MQ's firmware code. The MCP2518 chip is already ported by default in the processor. 1. Porting the MCP2518 chip driver Create a folder named "mcp25xxfd" under the path "OK8MP-linux-kernel/drivers/net/can/spi/". Place the relevant files (including .c files, .h files, Makefile, Kconfig, etc.) in this folder. 2. Complete the definition of can _ rx _ offload _ add _ manual function. vi OK8MQ-linux-kernel/include/linux/can/rx-offload.h Add: int can_rx_offload_add_manual(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight) vi OK8MQ-linux-kernel/drivers/net/can/rx-offload.c Add: int can_rx_offload_add_manual(struct net_device *dev, struct can_rx_offload *offload, unsigned int weight) { if (offload->mailbox_read) return -EINVAL; return can_rx_offload_init_queue(dev, offload, weight); } EXPORT_SYMBOL_GPL(can_rx_offload_add_manual); 3. Modify Makefile and Kconfig under the previous directory SPI/ vi OK8MP-linux-kernel/drivers/net/can/spi/Makefile Add: obj-y += mcp25xxfd/ vi OK8MP-linux-kernel/drivers/net/can/spi/Kconfig Add: source "drivers/net/can/spi/mcp25xxfd/Kconfig" 4. Modify the driver configuration file and compile the MCP2518 into the kernel vi OK8MP-linux-kernel/arch/arm64/configs/OK8MP-C_defconfig Get:CONFIG_CAN_MCP251X=y Change to:# CONFIG_CAN_MCP251X is not set Add:CONFIG_CAN_MCP25XXFD=y 5. Configure the clock in the device tree vi OK8MP-linux-kernel/arch/arm64/boot/dts/freescale/OK8MP-C.dts Add: clocks{ mcp2518fd_clock: mcp2518fd_clock{ compatible = "fixed-clock"; #clock-cells =; clock-frequency =; }; }; 6. Find a pin to use as the interrupt pin of the chip GPIOUNK1IO21 is used as an interrupt pin here. vi OK8MP-linux-kernel/arch/arm64/boot/dts/freescale/OK8MP-C.dts Add: pinctrl_ecspi2_can: ecspi2can{ fsl,pins = < MX8MP_IOMUXC_SAI2_RXFS__GPIO4_IO21 0x40000 >; }; 7. Modify in the ecspi2 node of the device tree vi OK8MP-linux-kernel/arch/arm64/boot/dts/freescale/OK8MP-C.dts From: &ecspi2{ #address-cells=; #size-cells=; fsl,spi-num-chipselects=; pinctrl-names= "default"; pinctrl-0= <&pinctrl_ecspi2 &pinctrl_ecspi2_cs>; cs-gpios= <&gpio5 13 GPIO_ACTIVE_LOW>; status= "okay"; spidev1:spi@0 { reg=; compatible= "rohm,dh2228fv"; spi-max-frequency=; }; }; Change to: &ecspi2{ #address-cells=; #size-cells=; fsl,spi-num-chipselects=; pinctrl-names= "default"; pinctrl-0= <&pinctrl_ecspi2 &pinctrl_ecspi2_cs &pinctrl_ecspi2_can>; cs-gpios= <&gpio5 13 GPIO_ACTIVE_LOW>; status= "okay"; mcp1:mcp2518fd@0{ compatible= "microchip,mcp2518fd"; reg=; spi-max-frequency=; clocks= <&mcp2518fd_clock2>; interrupts-extended= <&gpio4 21 IRQ_TYPE_LEVEL_LOW>; }; }; After completing the above modifications, you can compile and burn the OKMX8MP-C development board with the newly generated image. Connect the MCP2518 chip to the SPI2 interface, start the OKMX8MP-C development board, and then use the ifconfig -a command to view it, and you can see that there is one more CAN node. Originally published at www.forlinx.net.
  1. Load more activity
  • Create New...