Use 1837 sdk periph_i2cm_polling example
IDE LPCXpresso
I tried to read and write some data, and I read some information
But I don’t know how to write 3bit
E.g
Write 0x2e
Read out as 0x00
As shown below 1.png
Hope someone can help me
Thank you
static void SetupXferRecAndExecute(uint8_t devAddr,
uint8_t *txBuffPtr,
uint16_t txSize,
uint8_t *rxBuffPtr,
uint16_t rxSize)
{
/* Setup I2C transfer record */
i2cmXferRec.slaveAddr = devAddr;
i2cmXferRec.options = 0;
i2cmXferRec.status = 0;
i2cmXferRec.txSz = txSize;
i2cmXferRec.rxSz = rxSize;
i2cmXferRec.txBuff = txBuffPtr;
i2cmXferRec.rxBuff = rxBuffPtr;
Chip_I2CM_XferBlocking(LPC_I2C0, &i2cmXferRec);
}
static void WriteBoard_I2CM(int writeVal)
{
uint8_t tx_buffer[3];
/* set configuration to default value */
tx_buffer[0] = BANK_0; /* Write to Config register */
tx_buffer[1] = 0;
SetupXferRecAndExecute(SMB_ADDR, tx_buffer, 3, NULL, 0);
}
static void BANK0_read()
{
uint8_t tx_buffer[3];
uint8_t rx_buffer[3];
tx_buffer[0] = BANK_0; /* Read the Voltage across the shunt */
rx_buffer[0] = 0;
Write_BAN0();
SetupXferRecAndExecute(SMB_ADDR, tx_buffer, 1, rx_buffer, 2);
DEBUGOUT("BANK_0: 0x%02X%02X\r\n", rx_buffer[0], rx_buffer[1]);
}
Hello Wade,
I still don't understand what you mean with 3bit, but since this sometimes works and other times don't I will suggest checking the signal with an oscilloscope to discard any hardware problems.
Also, I'm not familiarized with this device so be sure the write sequence an address is doing correctly.
Let me know your findings.
Best Regards,
Alexis Andalon
HI Alexis_A
Excuse me, how does this board enter ISP MODE?
I do not see COME ACMO in LINUX
Hello @wade985136 ,
There are two ways to enter the ISP mode:
Best Regards,
Alexis Andalon
hi Alexis_A
How to modify it? ISP ROM API in your software.
Thank you
Hello @wade985136 ,
In the following link you can find a list of example to use with the LPC18xx. In this package there's an example called flashIAP that has a list of ROM commands, the reinvoke IAP between them.
You need to also import these projects to your workspace if you want to run these examples:
Best Regards,
Alexis Andalon
hiAlexis_A
1. How do I see vcom on linux?
2. Do you want to change from uart isp mode?
3. Which version of sdk are you using in the iap mode mentioned earlier
I am using sdk 3.02 version
Thank you
Best Regards
Hello @wade985136 ,
1. How do I see vcom on linux?
Please try this command:
dmesg | grep tty
2. Do you want to change from uart isp mode?
I'm not understanding this question, but the usual procedure to communicate with the ISP is to send the command unlock to start the communication.
3. Which version of sdk are you using in the iap mode mentioned earlier
I'm using the SDK including in the MCUXpresso 2.20 but the one you're using the latest one should be better.
Best Regards,
Alexis Andalon
Hello, Alexis_A
I tried many times, I still can’t change uart isp to usb isp
Can you help me, how can I modify it?
Hello @wade985136,
Please check the Table 16. Boot mode when OTP BOOT_SRC bits are zero, this section mention the state the boot pins need to be to boot from the different available sources:
Best Regards,
Alexis Andalon
1. Is there any tool to do FLASH update on ARM LINUX
2. When I execute the IAP SDK, after displaying the ID, no other things will be displayed. Do I need to enter other commands?
Hello @wade985136 ,
Usually, we use the flash magic tool (link) to communicate with LPC devices in ISP mode but this is only available for windows.
Also, we have a tool called LPCScrypt (link) that can be used for this purpose.
Best Regards,
Alexis Andalon
Hello Wade,
I don't understand what are you trying to achieve, for what I'm understanding is that you're trying to read/write a register from other device but the device is not answering as expected, am I right?
Best Regards,
Alexis Andalon
HI Alexis_A
When I tried to write 3BIT,
Sometimes it succeeds, sometimes it fails
tx_buffer [0] = 0x03;
tx_buffer [1] = 0x0C;
tx_buffer [2] = 0x30;
tx_buffer [3] = 0xC0;
thank you for your help
YES