LPC11C24: give incoming MISO signal with CAN out

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC11C24: give incoming MISO signal with CAN out

1,288件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Uncle Dave on Mon Aug 04 06:31:32 MST 2014
Hi Everybody,

at first I want to tell you I'm german, so please don't care about my English too much  :bigsmile:

Well, I got a task at work to programm the lpc11c24.
The clue is to give the signal (24 bits) I recieve from a switch detection at the MISO pin (PIO 2_2) with the CAN out.

So my question is, is this possible, or do I have to do this on another way?

And do I have to set any registers for giving only one simple signal?

I hope you understand my question  :bigsmile: ,

Dave

ラベル(1)
0 件の賞賛
返信
10 返答(返信)

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Sat Aug 16 05:12:25 MST 2014

Quote: sharif
...any suggestions please....



Start you own thread in LPC12xx forum...
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sharif on Sat Aug 16 03:03:53 MST 2014
Hi all,
i have lpc1227 board, i want to control my air conditioner through this board ,i had RAW codes of my AC remote but i get confused with how to activate PWM pins in this board , and how to  generate 38khz frequency , can any one help me to make an IR transmitter with this board , any suggestions please....
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Uncle Dave on Tue Aug 05 05:50:10 MST 2014
Thanks a lot LabRat,

you helped me a lot!!

:)
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Aug 05 05:22:58 MST 2014
This code snippet is using C_CAN on-chip drivers (User Manual 10398 Chapter 17) to transmit Message Object 0.

That's an easy point to start your work  :)

Just change data[] , mode_id and dlc if required.

As described in UM (17.4.11 CAN message transmit callback) it's a good idea to add a flag to control your transmission. That's also avoiding problems with transmitting messages too fast...

But in general this sample (at least with LPCXpresso) is very useful to learn how CAN messages are received and transmitted  :)

0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Uncle Dave on Tue Aug 05 05:06:03 MST 2014
Hopefully the last time I have to ask something^^

I have several if loops, and I have to send different codes via CAN for the different cases, is the following code part enough for the if loops, or is there anything to add or even to dismiss?

/* Send a simple one time CAN message */
  msg_obj.msgobj = 0;
  msg_obj.mode_id = 0x345;
  msg_obj.mask = 0x0;
  msg_obj.dlc = 4;
  msg_obj.data[0] = 'T'; // 0x54
  msg_obj.data[1] = 'E'; // 0x45
  msg_obj.data[2] = 'S'; // 0x53
  msg_obj.data[3] = 'T'; // 0x54
  LPC_CCAN_API->can_transmit(&msg_obj);
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Aug 05 04:25:38 MST 2014

Quote: Uncle Dave
so I hope this code works with CoIDE, because my mates use the same program and don't want to change it anymore. I'm just programming a part of the whole job.



Beside hoping and praying it could be a good idea to ask them if they've reserved ROM RAM  :)

http://www.lpcware.com/content/faq/lpcxpresso/reserving-ram-rom-drivers

Or just look in the map file...
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Uncle Dave on Tue Aug 05 03:24:39 MST 2014
Thanks again,

well the sample
nxp_lpcxpresso_11c24_periph_ccan_rom

is pretty much the same like
http://docs.lpcware.com/lpcopen/v1.03/ccan__rom_8c_source.html

so I hope this code works with CoIDE, because my mates use the same program and don't want to change it anymore.
I'm just programming a part of the whole job.
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Aug 05 02:21:37 MST 2014

Quote: Uncle Dave
Do I have to use the whole code?
http://docs.lpcware.com/lpcopen/v1.03/ccan__rom_8c_source.html
I don't really know if there is a code part I don't need



:)

No, you don't have to use the whole code.

Download LPCOpen (LPCXpresso LPC11C24 board v2.00a)

http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc11xx-packages-0

and use the sample:

nxp_lpcxpresso_11c24_periph_ccan_rom.

Probably you should read:

http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quicks...

before  :bigsmile:

And of course:

http://www.lpcware.com/system/files/LPCXpresso_User_Guide_0.pdf


0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Uncle Dave on Mon Aug 04 22:47:01 MST 2014
Thanks a lot, LabRat

I have just a few more questions.

The first question is:
Do I have to include any libraries?

And the second question is:
Do I have to use the whole code?
http://docs.lpcware.com/lpcopen/v1.03/ccan__rom_8c_source.html
I don't really know if there is a code part I don't need
0 件の賞賛
返信

1,264件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Mon Aug 04 09:01:56 MST 2014

Quote: Uncle Dave
I hope you understand my question  :bigsmile:



I'm not sure 

Just copy LPCOpen CCAN sample and put your 24bits in 3 bytes...

/* Send a simple one time CAN message */
msg_obj.msgobj  = 0;
msg_obj.mode_id = 0x345;
msg_obj.mask    = 0x0;
msg_obj.dlc     = 4;
[color=#f00]msg_obj.data[0] = 'T';// 0x54
msg_obj.data[1] = 'E';// 0x45
msg_obj.data[2] = 'S';// 0x53[/color]
msg_obj.data[3] = 'T';// 0x54
LPC_CCAN_API->can_transmit(&msg_obj);



Work done 
0 件の賞賛
返信