Hi i was previously using the atmel at91 microcontroller and for all the register values i was refering the foolowing header files Linux/atmel_serial.h and linux/atmel_pdc.h.
Now i have shifted to an Texas Instruments devgeloper board which is using am335x processor so i want to know where i can find the same relavent files for this instrument.
The list of registers that i am using in my code when i was working on the atmel board was
ATMEL_PDC_RPR
ATMEL_PDC_RCR
ATMEL_PDC_TPR
ATMEL_PDC_TCR
ATMEL_PDC_TNPR
ATMEL_PDC_TNCR
ATMEL_PDC_PTCR
ATMEL_PDC_TXTEN
ATMEL_US_CR
ATMEL_US_TXEN
ATMEL_US_RXDIS
ATMEL_US_IER
ATMEL_US_TXEMPTY
ATMEL_US_RXRDY
ATMEL_PDC_RXTEN
ATMEL_US_RTOR
ATMEL_US_TIMEOUT
ATMEL_US_OVRE
ATMEL_US_FRAME
ATMEL_US_PARE
ATMEL_US_RSTSTA
ATMEL_PDC_RXTDIS
ATMEL_US_RETTO
ATMEL_US_STTTO
ATMEL_US_CSR
ATMEL_US_IDR
ATMEL_US_TXDIS
ATMEL_US_RXEN
ATMEL_PDC_TXTDIS
ATMEL_US_MR
ATMEL_US_USCLKS
ATMEL_US_CHRL
ATMEL_US_NBSTOP
ATMEL_US_PAR
ATMEL_US_USCLKS_MCK_DIV8
ATMEL_US_CHRL_8
ATMEL_US_NBSTOP_1
ATMEL_US_PAR_NONE
ATMEL_US_IMR
ATMEL_US_BRGR
ATMEL_PDC_RNPR
ATMEL_PDC_RNCR
ATMEL_US_RSTRX
ATMEL_US_RSTTX
PDC_RX_TIMEOUT
ATMEL_US_USMODE_RS485
ATMEL_US_TXRDY
I need the equivalent for the TI am335x development board.Thanks
please refer to the device datasheet for device registers:
http://www.ti.com/litv/pdf/spruh73i
In Linux each device driver has it's own internal definitions of registers for which it has appropriate access rights. There is no unique place which defines all peripheral registers like Atmel does.
Related
I am working on a project using a Atmega644 and want to include EEPROM data in the initial programming.
I am using MPLAB X and the XC8 compiler (version 2.31) and for programming I am using a PICkit4.
I know that the xc8 compiler for PIC MCUs has the __EEPROM_DATA() macro, that would be pretty much perfect for my usecase. The AVR version of the compiler, however does not appear to have this macro (I tried both with and without CCI syntax...), as it does not recognize the call and just throws an error when trying to compile.
I have looked through the manual for the compiler, but it does not list any macros/functions to do this.
I tried adding the macro myself, by copying it from the PIC compiler to a header in my project, but it seems to contain assembly instructions that do not exist on the atmega and I couldn't even find those in documentation for the PIC (Otherwise I would have tried to find an equivalent instruction and replace them)...
Is there another way to include the initial EEPROM data in the project, so it gets written to the mcu during programming?
__EEPROM_DATA() macro is supported only for 8-bit PIC baseline and mid-range devices. There is also __eeprom qualifier to position variables in EEPROM. But none of these are for AVR chips.
Microchip supports AVR chips in XC8 using avr headers. There is an eeprom header which has some macros defined. One of these macros is EEMEM. You can use it to set EEPROM values at programming time. Here is how you use it:
#include <avr/eeprom.h>
char EEMEM nums[] = { 1, 2, 3, 4, 5 };
There is good information regarding the usage of this macro in this and this SO answers. Make sure to have a look at them.
I also recommend you to take a look at MPLAB XC8 C Compiler User's Guide for AVR MCU in case you didn't know about it.
It was successful to train from jet son-XAVIER and recognize it as cam. But I don't know how to send the information that jet son-XAVIER recognized in real time to Arduino. The objects we recognize are elk and wild boar. I know that I can only send 1 letter through communication, so elk will send e and wild boar to w. Is there a way to send it as soon as it recognizes it through real-time web cam?
There's not a lot of information here on your setup, but here's a possible solution:
I see the NVIDIA Jetson AGX Xavier module has USB-C ports.
Buy a USB-A to USB-C cable, and plug the Arduino directly in.
I'm not sure what program/language you're using with your trained model, but I'll guess that it's python for now.
You'll want to open a Serial connection to the arduino, and you can do this with pyserial:
https://pypi.org/project/pyserial/
You can send more than just one letter, you can send entire data streams. But, if you want to just send one letter, it will do that as well.
Here's the official documentation for how to communicate with an Arduino using Python:
https://create.arduino.cc/projecthub/ansh2919/serial-communication-between-python-and-arduino-e7cce0
If you're not using python, specify your language of choice, and we can look up and see if it has a serial library.
I have never used darknet but may be this can point you in the right direction.
I have used the library sugested by Bucky and I believe you could add the serial comunication to darknet.py. This is what I would do:
#Add this import at begining of the file darknet.py
import serial
#########################################################
#this is a mocked version of detect in darknet.py, assuming that the labels you used are "elk" and "wildboard". You should not add this lines to the file.
def detect():
res = []
res.append(("elk",0.98,(2,2,50,50)))
res.append(("wildboard",0.98,(2,2,50,50)))
return res
r = detect()
##########################################################
#Add this after the 'print r' at the end of the file darknet.py
ser = serial.Serial('/dev/ttyUSB0') # open serial port. You should check what serial port is assigned to your arduino.
for obj in r:
if obj[0]=="elk" and obj[1]>=0.9: #assuming 0.9 as the minimum confident for a detection
print "found elk"
ser.write('e') # you can send a string with just one letter
elif obj[0]=="wildboard" and obj[1]>=0.9:
print "found wildboard";
ser.write('w') # you can send a string with just one letter
ser.close() # close port
I am having some issues getting stock code to compile for my 9 axes motion shield. I have a github repository with all of the motion libraries I have, the example code, and the error messages I am getting.
I am using Arduino 1.7.1 IDE on Windows 7 64-bit.
I have tried using sample code for the sensor instead of for the shield and could not get that to compile either. I have tested example code built into the IDE to ensure that I can compile something and I was even able to interface with my Arduino MEGA 2560 with said code.
I have searched Google and Stack exchange a fair bit and have not managed to come up with any solutions.
The main error I can not figure out is:
"
C:\Users\LJI_eric\Documents\Arduino\sketch_mar20a\sketch_mar20a.ino: In function 'void setup()':
sketch_mar20a:63: error: 'OPERATION_MODE_NDOF' was not declared in this scope
mySensor.setOperationMode(OPERATION_MODE_NDOF);"
OPERATION_MODE_NDOF is a mode that is defined in BNO055.h and is an array of operation modes. I tried several other modes to no avail.
I would appreciate any and all help.
On line 84, 87 and 91 you have made a new line inside a string. You can not do that on the Arduino. If you want to break a string up in more lines you should end the string where you would break it, and start the string again on the new line, like this.
Serial.println("Move the device around and then place it at one position.\n"
"Change the threshold and duration to increase the difficulty level.");
Then you should change OPERATION_MODE_NDOF to BNO055_OPERATION_MODE_NDOF
I noticed this question has been asked many times in the past and surfing the web I found many pages about it. However, it seems like the proposed solutions rarely work and, in my case, the problem does not refer to a program that I wrote. So I'll give it another try here.
I recently installed Linux Mint 14 on my laptop. After the OS was spick and span, I started to install the software I need, and among these netgen (a Mesh Generator software). I tried both ways: download+unpack+compile+install and synaptic. Either way, this is the output I get when I try to execute the program
X Error of failed request: BadAlloc (insufficient resources for operation)
Major opcode of failed request: 154 (GLX)
Minor opcode of failed request: 3 (X_GLXCreateContext)
Serial number of failed request: 490
Current serial number in output stream: 491
As I said, I surfed the web, and apparently, this is thought to be linked to some problem in the X server configuration. And here start the mess. Someone says I should modify /etc/X11/Xorg.conf, adding the lines
Option "Videoram" "65536"
Option "Cachelines" "1980"
Under the section "Device." Unfortunately, I have no such file, as apparently in recent distros, the X configuration file has been moved to /usr/share/X11/xorg.conf.d/* and it's now split into different files. The one about the monitor and graphics should be called 10-monitor.conf...which I don't have. I tried to create one, following the instruction at this link, and then add those lines, but nothing happened. To be fair, I'm not 100% sure I generated the file correctly since I am not sure how to detect the driver for my graphics card.
I don't know how much and which information people would need to have an idea of how to fix this problem. Here's what I see might be useful.
The output of 'lspci | grep VGA' is
01:05.0 VGA compatible controller: Advanced Micro Devices [AMD] nee
ATI RS880M [Mobility Radeon HD 4200 Series]
My current /usr/share/X11/xorg.conf.d/10-monitor.conf is the following
Section "Monitor"
Identifier "Monitor0"
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "LVSD"
Driver "fglrx" #Choose the driver used for this monitor
EndSection
Section "Screen"
Identifier "Screen0"
Device "LVDS"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080_60.00" "1366x768"
EndSubSection
EndSection
Under the section "Device." Unfortunately, I have no such file
Try creating your own xorg.conf file, placing it in this location will override your X settings after restarting X or simply by restarting the computer.
mkdir -p /etc/X11/xorg.conf.d/
cp /etc/X11/xorg.conf.d/xorg.conf /etc/X11/xorg.conf.d/xorg.conf.bk # in case it exists
cp /usr/share/X11/xorg.conf.d/10-monitor.conf /etc/X11/xorg.conf.d/xorg.conf
The content of /etc/X11/xorg.conf.d/xorg.conf would look like (adding your options):
Section "Monitor"
Identifier "Monitor0"
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
EndSection
Section "Device"
Identifier "LVSD"
Driver "fglrx" #Choose the driver used for this monitor
Option "Videoram" "65536"
Option "Cachelines" "1980"
EndSection
Section "Screen"
Identifier "Screen0"
Device "LVDS"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080_60.00" "1366x768"
EndSubSection
EndSection
This also could be related to the driver you're using, there are other common drivers available like
Driver "fbdev"
Driver "vesa"
Driver "fglrx"
The fbdev driver supports all hardware where a framebuffer driver is available.
The vesa driver supports most VESA-compatible video cards. There are some known exceptions, and those should be listed here.
fglrx is a X.org(7x) driver for ATI (Mobility(TM)) RADEONĀ® and (Mobility(TM)) FireGL(TM) based video cards. The driver provides hardware acceleration for 3D graphics and video playback. It includes support for dual displays, TV Output and as of version 8.21.7 also OpenGL 2.0 (GLSL).
Depending on which driver you choose, certain options/functionality/compatibility would be enabled or not, you could change the driver and test with the options you said would work.
Finally, you have hundreds of options here to play with X11.
When I had made written a lot text to my program I took similiar error. When I reduce the text size the error was disappeared. I think you should reduce too showing things or reorganise how they are looking on screen.
I hope I could help you with this broken English ;)
I'm trying to get the SIM number (ICCID, not IMSI) of my 3G Huawei E5830 modem using AT commands (also called Hayes command set).
Unfortunately, it's not specified in the modem formal documentation.
for sim900 AT+CCID
gives CCID.
e.g.89912200000280775659
The first two digits (89 in the example) refers to the Telecom Id.
The next two digits (91 in the example) refers to the country code (91-India).
The next two digits (22 in the example(MNC of IDEA)) refers to the network code.
Try "AT^ICCID?". tested on Huawei E173.
It works with AT+CRSM and also AT+CSIM.
AT+ICCID on galaxy S4 in modem mode.
AT+CICCID on an Iridium satellite modem.