Hardware Peripheral Write using Address

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Hardware Peripheral Write using Address

937 次查看
athmesh_n
Contributor IV

I'm working on MODBUS protocol, where I have to write to pin using address given by master. Is it possible to write to a peripheral using peripheral address?

IDE: MCUXpresso

Controller : LPC1517

Brief:

I would like to write to GPIO PIN PIO1_0, whose byte address is 0x1c000020. So, in order to make the pin high, should I write to address 0x1c000020? I tried using the following code: 

 uint8_t volatile *gpio = (uint8_t *)0x1c000020;
 *gpio = 0x1;

Is it possible to do so?a

标签 (1)
标记 (3)
0 项奖励
回复
2 回复数

826 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ATHMESH NANDAKUMAR ,

Yes, you can.

Do you have any problem when you using it ?


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

826 次查看
athmesh_n
Contributor IV

No I used a different method

0 项奖励
回复