Setting up multiple DACs on an STM32F4-Nucleo - stm32

I am working on a project that requires me to use 5 TLC7524 DACs. They will all be receiving data from an 8 bit bus. For data transfer, the process is CS pin, WR pin, send Data. I was wondering if I could get away with grounding the CS pin on all of them and control them with just the WR pin.
Link to datasheet for TLC7524 -
http://www.ti.com/lit/ds/slas061d/slas061d.pdf

Usual way is select the DAC by /CS and the /WR signal is common for all of them.
In this way, you can connect it on FMC and create the /CS for each chip from the address (FMC is available on Nucleo144 boards, but not on Nucleo64 ones).
Also selected chips may have much higher current consumption (as they are active). For example SRAM chips are using much more current when enabled by /CS.

Related

Allocate Micropython array from a specific memory range

I'm using Micropython on an ESP32-S3. I'm setting up DMA from an ADC by manually configuring the appropriate registers using mem32. I need to reserve some space in the SRAM1 region of Internal RAM for the linked list of descriptors. i.e. In address range 0x3FC88000 to 0x3FCEFFFF.
Is there something like array.aray() that lets me specify a range?
I assume either drivers or some other internal Micropython plumbing under the hood is already using some of that internal RAM address space, as I see non-zero values in it. I want to make sure my code doesn't stomp on anything being used (or vice versa).

Can a holding register in the middle of readable holding registers be an "IllegalDataAddress"?

While unit testing a Modbus driver I'm writing I experienced the following:
I can read holding registers 0 to 1022.
I can't read holding registers 1022 to 13000. I get an illegal data address error code.
I can read holding registers 13000 to 25000.
I would have expected devices supporting Modbus to behave in one of the following two ways:
Every device supports the full range of addresses from 0x0000 to 0xFFFF.
Every device supports a range of addresses from 0x0000 to N, where N < 0xFFFF.
Do any of you more experienced people know:
Is Assumption 1 or 2 about the expected behavior of Modbus devices correct?
Are there other reasons beside being out of bounds for an address to be an illegal data address?
Both assumptions are false. It's completely up to the device to decide which registers to support. Some devices are nice and support a wide range of registers, even if they're unused. Most that I've used don't, though. They'll use groups of registers, like your device.
Also, not all Modbus devices support all the Modbus function codes. Just because it's defined by the Modbus protocol standard doesn't necessarily mean the device will support it.
The key thing is to stick to the addresses defined in the device's manual. The manual is usually required reading, otherwise you'll just be guessing at the ranges, units, and scaling.

npa201 i2c address change

I need to change an i2c address of an amphenol nova sensor NPA201 (pressure) using an stm32F407-discovery board.
An application note provided by manufacturer raises some questions.
According to the table, the one must set cpu's i2c module to master-receiver mode, and immediately send a byte to sensor. Is it even possible to do so?
May be i need to read reference manual one more time, buy as far as i know such situation is not described there.
Has anybody done the changing address procedure before?
table
Information for changing the address of the sensor can be found here Please note you can only change it three times. The default i2c address is 0x27.

Send TCP/IP message from PLC to PC using Ladder Program

Consider the following Ladder Program that checks if a connection is enabled (A202.00) then send a message from the PLC to the PC.
The documentation (Omron CX-Programmer) has a severe lack of explanation of the program convention. What I do not understand is:
To send a message from a node to a node. I should need to specify the receiver ID. It seems the function block does not have an option where I can insert an IP address. Am I supposed to MOV an IP address to a DM address (D300) then use it? If that's the case how (IP address has dots in between 4 bytes..)?
Can someone please explain what is S (First source word), D (First destination word) and C (First control word). Aren't they just memory address? E.g. sending content of a memory adress to another memory address?
[EDIT]
What am I trying to do?
I am trying to interface a measuring gauge (controlled through Ethernet by PC/C# application) to a robotic system (no RS232 or serial, no TCP/IP, only has the simplest I/O points) with an Omron PLC. When gauge completes a measurement, the C# app sends a command to the Omron PLC which, according to the command received, switch ON or OFF an output which triggers a voltage flow to the robot's I/O port.
Should I use FINS? What functions/protocol from the PLC I need to know to do this? I do not know so I am testing every function from the documentation. So far, zero progress.
1) All addressing information is encapsulated in the five control words (C -> C+4). C- "First Control Word" is the pointer to the first word in this table of five words you must have stored somewhere in your PLC to set up the communication.
2) First source word points to the first word in your PLC you wish to send. First destination word points to the first address in the PLC/device you wish to send to. In the example , the first control word specifies that 10 words should be sent. You point to the first one and it will send that one plus the next nine addresses as well.
To do this you have to use FINS communication - the PC stores a memory structure similar to the PLCs (CIO, DM, etc) called Event Memory and these are the addresses in the PC you are pointing to. The PC gets a FINS node number and address just like a PLC would - no IP addresses are involved. (see : FINS Manual) FINS is old, however, and has been superceded by things like Sysmac Gateway.
There are much better ways of communicating between PLC/PC, however, depending on what you are trying to do. Are you trying to write an HMI? If so, what language are you using?
Edit :
If you're using C#, I highly recommend you look into Sysmac Gateway and CX-Compolet. This is probably the most flexible, simple, and extensible way to get .NET working with Omron PLCs. If it is at all possible, however, a better way might even be to have the measurement unit communicate directly with the PLC via hardware I/O (relays, DIO, etc).
CX-Compolet, Sysmac Gateway link:
http://www.ia.omron.com/product/family/63/index_l_u.html

USB windows xp final USB access issues

I basically understand you C++ people, Please do not get distracted because I'm writing in Delphi.
I have a stable USB Listing method that accesses all my USB devices
I get the devicepath, and this structure:
TSPDevInfoData = packed record
Size: DWORD;
ClassGuid: TGUID;
DevInst: DWORD; // DEVINST handle
Reserved: DWord;
end;
I get my ProductID and VenderID successfully from my DevicePath
Lists all USB devices connected to the computer at the time
That enables me to access the registry data to each device in a stable way.
What I'm lacking is a little direction
Is friendly name able to be written inside the connected USB Micro chips by the firmware programmer? (I'm thinking of this to identify the device even further, or is this to help identify Bulk data transfer devices like memory sticks and camera's)
Can I use SPDRP_REMOVAL_POLICY_OVERRIDE to some how reset these polices
What else can I do with the registry details.
Identifying when some one unplugs a device The program is using (in windows XP standard)
I used a documented windows event that did not respond.
Can I read a registry value to identify if its still connected?
using CreateFileA (DevicePath) to send and receive data
I have read when some one unplugs in the middle of a data transfer its difficult clearing resources.
what can IoCreateDevice do for me and how does one use it for that task
This two way point of connection status and system lock up situations is very concerning.
Has some one read anything about this subject recently?
My objectives are to
1. list connected USB devices
identify a in development Micro Controller from everything else
send and receive data in a stable and fast way to the limits of the controller
No lock up's transferring data
Note I'm not using any service packs
I understand everything USB is in ANSI when windows xp is not and .Net is all about ANSI
(what a waste of memory)
I plan to continue this project into a .net at a later date as an addition.
MSDN gives me Structures and Functions and what should link to what ok but say little to what they get used for.
What is available in my language Delphi is way over priced that it needs a major price drop.
I found the registry DEVICE_INSTALL_STATE with :-
InstallStateInstalled = 0,
InstallStateNeedsReinstall = 1,
InstallStateFailedInstall = 2,
InstallStateFinishInstall = 3
I ask the question of how fast is the updated response and if their is a better way to do this
Lex Dean