Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Prakash

Pages: [1]
1
NXPTM LPC2XXX and LPC17XX / LED(GPIO) ON/OFF using EMAC Protocol (LPC1768 )
« on: December 20, 2011, 02:27:13 PM »
Hello,

I am very new to EMAC. I have chosen the controller LPC1768 which have
inbuilt Ethernet MAC.

I am trying to write firmware to operate some leds connected to LPC1768
Board using EMAC protocol.i.e Ethernet cable is connected between
LPC1768 Board and Laptop, make led on/off by laptop through EMAC.

It would be great if somebody give thoughts on it.

Thanks in advance.

2
Hello,

I am downloading the program on LPC1768 target board using CoiNel
ARM-USB-JTAG through Keil micro-vision 4.03. After programming, target
board going to reset mode. The programmed code will work only after
unplug the USB cable which is connected to the CoiNel ARM-USB-JTAG.

Is there any setting have to do on Keil IDE?

Many thanks in advance.

3
NXPTM LPC2XXX and LPC17XX / EFSL how to check bmp files in dir
« on: July 11, 2011, 06:39:59 AM »
Hello,

I have interfaced EFSL(SD Card) with LPC1768 and its working fine. But I
am not able to check the number of bmp files in current dir.

 ls_openDir(&list ,&(efs.myFs ),"/");

while(ls_getNext(&list)==0)

The above code is for open the dir and get next file list. Please give
some thoughts on how to get num of bmp files in current dir.

The EFSL code is at Downloads section of
http://coineltech.com/shop/product_info.php/cPath/...
"LPC1768 HPLUS Saple Code".

4
NXPTM LPC2XXX and LPC17XX / Compiler (Assembling) error lpc1768
« on: October 26, 2010, 11:41:59 AM »
Hello,

I am new to the assembly code. The code which I given below is compile(assembling) fine in KEIL.

AREA |.text|, CODE, READONLY

EXPORT vF_dspl_pid

vF_dspl_pid
push {r4-r7}

ldrsh Kp,[pS_StateCoeff]
ldrsh Ki,[pS_StateCoeff,#2]
ldrsh Kd,[pS_StateCoeff,#4]
ldrsh IntegratedError,[pS_StateCoeff,#6]

mla Acc,Ki,si_Error,IntegratedError //update integrated error
strh Acc,[pS_StateCoeff,#6] //store to state

ldrsh LastError,[pS_StateCoeff,#8]
strh si_Error,[pS_StateCoeff,#8]

mla Acc,Kp,si_Error,Acc //add in proportional part

sub Temp,si_Error,LastError
mla Acc,Kd,Temp,Acc //add in the difference part

mov Acc,Acc,ASR#16 //scale down to short int
pop {r4-r7}
bx lr

END


But when I switch from KEIL to ROWLEY CROSS WORKS. The foolowing errors are getting during assembling.

Error: bad instruction 'area |.text|,CODE,READONLY'

Error: bad instruction 'export vF_dspl_pid'

Error: bad instruction 'vf_dspl_pid'

Error: Thumb does not support this addressing mode -- 'ldrsh r3,[r1]'

Error: Thumb does not support this addressing mode -- 'ldrsh r4,[r1,#2]'

Error: Thumb does not support this addressing mode -- 'ldrsh r5,[r1,#4]'

Error: Thumb does not support this addressing mode -- 'ldrsh r6,[r1,#6]'

Error: Thumb does not support this addressing mode -- 'ldrsh r6,[r1,#8]'

Error: shifts in CMP/MOV instructions are only supported in unified syntax -- 'mov r7,r7,ASR#16'

Error: bad instruction 'end'
Build failed


Kindly give me suggession to get out of these errors.

-Prakash

5
µTasker general / Detecting Pen Drive Insertion on LPC1768
« on: October 05, 2010, 09:24:28 AM »
Hello

I am using LPC1768 for one of the project and i need to detect if the USB device is plugged in. How is it possible that i detect something like a pen drive being inserted.

I will be using the controller to interact to the PC as well as with a pendrive and i dont intend to use OTG. I need to have a option which will be able to detect the connection type.

Regards
Prakash

6
µTasker general / Reset on LPC1768
« on: September 09, 2010, 08:18:40 AM »
Hello,

I am using LPC1768 and programming it using ISP. What i have observed is that the programs that i load work fine but when i repower the LPC board, the code starts to work only after a reset.

The code executions should start after powerup.

Kindly let me know what could be the possible issue.

7
µTasker general / LPC1768 + Rowley CrossWorks 1.7 Reset Problem
« on: August 31, 2010, 06:11:08 AM »
Hello,

I have used start up files and xml files of
http://electronix.ru/forum/index.php?s=e6d164ca26ca991f502cf99e05f29e72&act=attach&type=post&id=38499
for led toggle. Its working fine in debug mode but after resetting, the control not goes to the main function.
 
It would be great if anyone could share light on this

-Prakash

8
Hi,

According to LPC17xx user manual the LPC1768 has a total of 64kB of SRAM. I understand that there is a 32kB bank of SRAM connected to the CPU's instruction and data busses, which is readily accessible.


There are two more 16kB banks of SRAM which are stated as typically being used for peripheral data but can supposedly still be used for general purpose instruction and data storage.


In my project I have to use 40kb to 45kb SRAM. Could you please anybody tell me how to use USBRAM? If any body can help on this, that will be very appreciated.

-Prakash
9886545216

9
NXPTM LPC2XXX and LPC17XX / asin function on LPC1768
« on: August 01, 2010, 08:14:09 AM »
Hello

I am using LPC1768 for a motor control application. The motor will be
controlled with a series of pulses each of 2us wide.

I use a asin function to calculate the time between two pulses. (The
motor moves clock and anti-clock wise, hence a sin function is
considered)

when asin function is called, the code tends to break. ie it gets stuck
at hardware handler routine.

I believe the issue is with the use of asin function, although i am not
sure about it. I am using inbuilt asin in math.h

Can anyone kindly suggest me how to use a asin function on LPC1768. If
anyone can provide me a small code for how to use it on LPC1768 would be
of great help.

I have tried the code on rowley crossworks and on Keil. Both seem to
give the same error. But in simulator asin function is working fine.

Kindly suggest.

Regards

Prakash

10
NXPTM LPC2XXX and LPC17XX / LPC1768 + 2.8" TFT ILI9325
« on: July 30, 2010, 02:15:15 PM »
Hello all,

I have an LCD module TM240320B9NFWUGWC and it has inbuilt ILI9325
controller.
MPU-Interface Mode is through 8-bit parallel interface.

I'm trying to read its device code but its not working, I always
getting 0x0000. If any body can help on this, that will be very
appreciated.

My code is as follow
------------------------------------------------------------------
void TSLCDInit(void) //initial LCD
{
TSLCDOutIns(TS_INS_START_OSC);
driver_code = TSLCDInDat();
if (driver_code == 0x9320) //ILI9320
{
TSLCDInit9320();
}
else if (driver_code == 0x9325) //ILI9325
{
TSLCDInit9325();
}
}
--------------------------------------------------------------------
But I am getting driver_code = 0x0000

And my write command, write data and read data as follow

void TSLCDOutIns(unsigned short ins) //write instruction to LCD
{
LPC_PINCON->PINSEL0 &= ~(0xFFFF<<4);
LPC_GPIO0->FIODIR |= LCD_DATA_MASK;

LCD_CS_LOW();
LCD_RS_LOW();
LCD_RD_HIGH();

LCD_WR_HIGH();
LCD_WR_LOW();
delay_ms(1);
LPC_GPIO0->FIOPIN &= ~LCD_DATA_MASK;
LCD_WR_HIGH();

LCD_WR_LOW();
delay_ms(1);
LPC_GPIO0->FIOPIN |= ins<<2;
LCD_WR_HIGH();

delay_ms(1);
}

void TSLCDOutDat(unsigned short dat) //write data to LCD
{
LCD_RS_HIGH();
LCD_RD_HIGH();
LCD_WR_LOW();

LPC_PINCON->PINSEL0 &= ~(0xFFFF<<4);
LPC_GPIO0->FIODIR |= LCD_DATA_MASK;
LPC_GPIO0->FIOCLR = LCD_DATA_MASK;
LPC_GPIO0->FIOSET = (dat >> 8 ) << 2;

LCD_CS_LOW();
LCD_CS_HIGH();

LPC_GPIO0->FIOCLR = LCD_DATA_MASK;
LPC_GPIO0->FIOSET = dat << 2;

LCD_CS_LOW();
LCD_CS_HIGH();
LCD_WR_HIGH();

LPC_PINCON->PINSEL0 &= ~(0xFFFF<<4);
LPC_GPIO0->FIODIR &= ~LCD_DATA_MASK;
}

unsigned short TSLCDInDat(void) //read data from LCD
{
unsigned short retval = 0;

LPC_PINCON->PINSEL0 &= ~(0xFFFF<<4);
LPC_GPIO0->FIODIR &= ~LCD_DATA_MASK;

LCD_CS_LOW();
LCD_RS_HIGH();

LCD_RD_LOW();
delay_ms(1);
retval = (LPC_GPIO0->FIOPIN & LCD_DATA_MASK);
LCD_RD_HIGH();
delay_ms(1);

LCD_RD_LOW();
delay_ms(1);
retval = (retval << 8 ) | (LPC_GPIO0->FIOPIN & LCD_DATA_MASK);
LCD_RD_HIGH();
delay_ms(1);

LCD_CS_HIGH();

return retval;
}

Note: For data lines I am using P0.2 to P0.9 and that's why I am
shifting 'ins' and 'dat' left by 2.

-Prakash
9886545216

11
NXPTM LPC2XXX and LPC17XX / TFT YM280T with LPC1768
« on: July 27, 2010, 12:13:54 PM »
Hello,

Is anybody work done on TFT YM280T, it inbuilt have ST7781 controller.

I need help on this.

-Prakash
9886545216

12
NXPTM LPC2XXX and LPC17XX / Ethernet Problem in LPC1768
« on: July 27, 2010, 05:57:05 AM »
Hello,

During configuration of Ethernet, JTAG is losing communication with the
target.

In LPC17xx manual there is a remark as follow

Remark: when initializing the Ethernet block, it is important to first configure the PHY and insure that reference clocks (ENET_REF_CLK signal in RMII mode, or both ENET_RX_CLK and ENET_TX_CLK signals in MII mode) are present at the external pins and connected to the EMAC module (selecting the appropriate pins using the PINSEL registers) prior to continuing with Ethernet configuration. Otherwise the CPU can become locked and no further functionality will be possible. This will cause JTAG lose communication with the target, if debug mode is being used.

Hopefully I have initialized correctly. Initialization have following
code,

/* Power Up the EMAC controller. */
SC->PCONP |= 0x40000000;

/* Enable P1 Ethernet Pins. */
PINCON->PINSEL2 = 0x50150105;
PINCON->PINSEL3 = (PINCON->PINSEL3 & ~0x0000000F) | 0x00000005;

/* Reset all EMAC internal modules. */
EMAC->MAC1 = MAC1_RES_TX | MAC1_RES_MCS_ TX | MAC1_RES_RX |
MAC1_RES_MCS_ RX |
MAC1_SIM_RES | MAC1_SOFT_RES;
EMAC->Command = CR_REG_RES | CR_TX_RES | CR_RX_RES;

Is there any problem in this configuration?

KS8721 PHY is the device which I am using in my board. And also I have attached schematic. Please let me know if is there any hardware issues?

Thanks in advance :)

-Prakash
9886545216

Pages: [1]