- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi all,
i am relatively new to Psoc development pardon my ignorance.
i am currently working on integrating accelerometer with the development kit.
i found an article on
http://www.cypress.com/?docID=19786
after consulting an expert, he noted to me that the application note i had referred is for connecting an Accelerometer to PSoC1 devices which have SAR and ADCINC incremental ADCs. PSoC3 does not have a SAR8 user module. Instead i can use the ideas proposed in the application note but substitute the ADC with the Deltasigma ADC from PSoC.
my doubts was the figure 3 of the block diagram of accelerometer with PSoC. the control software block does it co response to PSoC3's control register? same goes to the I2C block can it be replace by the component using the PSoC creator IDE?
as there is not a direct info on how i can edit the value of the blocks, i hope to get some kind expertise's advice on how about i can cont to work on this article.
any help will be greatly appreciated.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think you need an example on using the ADC on PSoC 3. There are a few around that you can run on the development board...
Simple ADC Example - http://www.cypress.com/?rID=38629
ADC Channel Scan with Software - http://www.cypress.com/?rID=38799
Also, although I do not think you have the hardware, you could look at the projects that come with the FirstTouch kit. That kit has a Kionix accelerometer on-board and several of the kit examples use it extensively.
CY8CKIT-003 PSoC® 3 FirstTouchtm Starter Kit - http://www.cypress.com/?rID=38235
-- mgs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi yfs,
thanks for the information.
i did notice that PSoC 3 FirstTouch Starter Kit has an accelerometer on it, however i had already bought the PSoC development kit, thus have no choice but to use the kit.
i am having quite a problem as i do not understand the differences in of the two.
is there some reference i can look into to so call "convert" the methodology use in the article (http://www.cypress.com/?docID=19786) to used in the PSoC creator and PSoC development kit?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is really nice of you to post this example project.
is there any documentation of this project i can refer to?
however it is using the on board accelerometer of first touch kit, which for me i may need to purchase a separate accelerometer and mount onto the breadboard of PSoC development kit?
by the way, i am still quite stuck to the article on my first post, as is really had to "convert" over to PsoC creator software.
furthermore i have been trying to tes out the ADC to LCD sample project that comes with the Creator software, it seems that my component bar is giving me problem,previous i could not find "ports and pins folder" thus i went to give an update to Creator 1.0.4beta, but certain components are gone again from the list after the update. i clearly remember the previous list was 84 components, now left with 64. now i am able to find "ports and pins folder" but the "digital port" under "system" is no longer there.
please advise.
thanks in advance for the help..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can find the documentation for the attached project in the PSoC First Touch user guide available from the below link.
http://www.cypress.com/?rID=38235
There have been some upgrades to components in the latest version of PSoC Creator. The digital port component is now replaced by the Digital Output Pin and Digital Input pin components. Also, you can view older components by enabling the "Show Hidden Components" option in the Tools >> Options menu, Design Entry >> Component Catalog option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The board you have is much more flexible that the FirstTouch kit. One option you have is to get a Kionix SC-7 eval board and plug it straight into the DVK bread board area. All you then to do is wire up the digital control lines and analog accelerometer input to the PSoC pins. Then take the FirstTouch examples (which use the Kionix part), move the pins to the ones you have chosen, and rebuild.
-- mgs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am purchasing a similar accelerometer( http://sgbotic.com/index.php?t...ts&product_id=440) to integrate on the PSoC development board.
Pardon my ignorance of the software knowledge, i was wondering from the concept of the article and the bubblelevel example,
1)since now the accelerometer i am using is 3axis should i follow the concept of the article, by using a mux? or sholud i use 3 individual ADC to read from each x,y and z?
as the x,y,z value from the accelerometer will be available for the ADC to read at the same time.
this lead to next question
2) if i was to use a mUX,there is two mux available in the creator software, i was thinking of using the AMUXSeq, as i need to differential x,y and z value.
is this a better choice out of the two?
3) since PSoC development board had its own LCD, from the article, i can remove the concept of I2C to display on the external device right?
however can the LCD display simultaneously 3 values by writing at the appropriate position of the LCD(ie i send to print string of x,y and z value at different position of the LCD)?
as the LCD is only one port, can it take in 3 functions to write at the same time?
or should i set the values of x,y,z in some buffer and display at one time?
4)can i also remove the concept of the control unit in the article?
as i will always on the accelerometer.
any help will be greatly appreciated.
thanks alot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can have only one ADC in PSoC3. You will have to use a mux to multiplex the X,Y and Z axes. The following example project (as yfs pointed out) shows how to measure multiple ADC inputs.
ADC Channel Scan with Software - http://www.cypress.com/?rID=38799
You can use the LCD_Position function to place the LCD cursor at any location and print the string you desire. You can convert the hex value from the ADC to decimal using the sprintf function and store the ascii string to a char array. Then use the LCD_PrintString function to print the ascii value at the desired location. You could set LCD Position to (0,0) and print X, (0,8) and print Y and (1,0) and print Z.
I have shown the code to print the decimal value using sprintf and LCD_PrintString in my below video.
http://www.youtube.com/watch?v=U21vjhzCJ0A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for the wonderful piece of reference.
i will test it out and share the result with all.
cheers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
i tested with the adxl335 accelerometer.
i make use of the example program which ganesh had provided for me.
i remove the two VDC8 module and replace them with analog pins.
i remove the 2 switches modules.
i edited the codes as i do not required the 2 switch interrupts.
i set channel 1 as P0_1, channel 2 as P0_2 and channel 3 as P0_3.
i connected my accelerometer at the respective x,y,z to P0_3,P02,P0_1.
i connect all the ground together inclusive of the accelerometer's ground, in order to make a common ground.
i set the VCC of the accelerometer to connect to the development's board's 3.3V pin.
however, there is no value being display on the LCD.
it display all 00 for the value of x,y and z.
code:
#include
uint8 iAdcValue[3];
void main()
{
uint8 iChannel=0;
LCD_Start();
LCD_Position(1,0);
LCD_PrintString("Z Y X");
LCD_Position(0,0);
AMuxSeq_1_Start();
AMuxSeq_1_Next();
ADC_DelSig_1_Start();
for(;
{
ADC_DelSig_1_StartConvert();
LCD_Position(iChannel/4,((4*iChannel)%16));
LCD_PrintInt8(iAdcValue[iChannel]);
iChannel=(iChannel+1)%3;
}
}
any advise will be greatly appreciated.
thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The example project reads the ADC result and changes the channel inside the ADC's ISR (see ADC_Delsig_1_IRQ.c file, ADC_DelSig_1_IRQ_Interrupt function.
In your project, you are not enabling the ADC interrupt and there is no code to change the channels or read the results in the foreground process. So, the result will always be zero. Do the following:
1. Remove the StartConvert function call from the for(; loop.
2. Enable the ADC ISR
3. Make sure that the code to stop ADC, read ADC result, change channel and StartConvert is inside the ADC's ISR.
4. When the channel switching is done inside the ADC's ISR, you need to only update the LCD display in the for(; loop.
My suggestion would be use the ADC channel scan project as it is and only remove the DACs and connect the analog pins to the Mux. You can also remove the code that starts the DACs and isr_1 and isr_2 in main.c.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
really thanks for the all help and information.
what i did was to follow your instructions, remove the DACs and connect the analog pins to the Mux and also remove the code that starts the DACs and isr_1 and isr_2 in main.c.
and it works perfectly.
thanks alot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thus i was trying to reverse engineer it as i like to learn how is it coded to scan through the ports of the MUX.
however i realize that only after i built the project then the ADC_DelSig_1_INT.c plus the rest of the files are created. is that the way to generate the files?
can i say that the files which i need to pay attention to beside the main.c,
are:
1.
ADC_DelSig_1_INT.c ==> as ADC_DelSig_1.c and ADC_DelSig_1.h are normal generated module files
2.
ADC_DelSig_1_IRQ.c ==> as ADC_DelSig_1_IRQ.h is normal generated module files
3.
ADC_DelSig_1_theACLK.c
is these the files which are modified to read in proper scanning of the mux?
once again thanks in advance for any help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
now if i like to display the values of x,y,z through the serial ports of the development boards to probably a PC hyperterm or even write to a file and saved into the PC, what is the necessary steps i have to do?
thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.cypress.com/?id=2232&rtID=113
The page also has example projects for various other features of the PSoC3.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have done using the UART.
is it possible to transmit(force) the hex value as a char using the serial?
i was trying to use strcat() to combine all the x,y,z value.
code:
char zout[6];
sprintf(zout,"%x",iAdcValue[0]);
UART_1_PutStringConst(zout);
with the codes above it seems to be giving me some funny characters.
and is it possible to clear the previous content of zout before i read the new value and send out again?
however was wondering can i send in this manner of "z:FF,y:FF,x:FF"?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
UART_1_PutString("z:");
sprintf(zout,"%x",iAdcValue[0]);
UART_1_PutString(zout);
UART_1_PutString(", y:");
sprintf(zout,"%x",iAdcValue[1]);
UART_1_PutString(zout);
UART_1_PutString(", x:");
sprintf(zout,"%x",iAdcValue[1]);
UART_1_PutString(zout);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
PutStringConst function comes from the UART example project function, iwas quite shock also that the function works although there is no such function listed in the data sheet.
i was thinking is there a way to send out the char array as a whole array?
as in this manner of of "z:FF,y:FF,x:FF"?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
as in maybe scan every 1 or 2 sec?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But you can also let the ADC scan happen at the ADC's scan rate, but read the ADC results in the foreground once in a second or two.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am facing some problems when i increase the resolution of the ADC.
i wish to change the ADC resolution to 16bits.
changes i made to the default ADC scanning example project:
-change the ADC resolution to 16bits.
-change the voltage reference tp 2times which now is 2.048V.
-change the ADC_DelSig_1_IRQ.c files, under the function
"CY_ISR(ADC_DelSig_1_IRQ_Interrupt)"
iAdcValue[iIndex]=ADC_DelSig_1_GetResult8(); to iAdcValue[iIndex]=ADC_DelSig_1_GetResult32(); ==> cause the data sheet indicated that if i use 16 it will return me signed 16bit result.
-change the LCD display in main.c
LCD_PrintInt8(iAdcValue[iChannel]); to
LCD_PrintInt16(iAdcValue[iChannel]);
however the result i got was only the last two hex number being display.
eg 00ab.
thus i use a hyperterm to check the output,
it always show as:
__20;
eg aa20;
bb20;
which the "20" is always attach at the back.
previous when i use the 8bit ADC, and when it send out through the serial port using UART, the value show on the hyperterminal something like:
__1f
eg aa1f;
bb1f;
there is always a 1f attached to the back of the 2hex value?
any advice what should i do to see the correct value for the 16bit ADC?
please help. thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I see that when your iAdcValue variable was a 8 bit variable. Are you sure you upgraded its size to 32 bit to taking the 32 bit ADC_result?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do i interface accelerometer ADXL345 to PSoc 5???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been given a task of interfacing the accelerometer ADXL 345 to PSoc5....But there is no one to guide me.....I have problems in writing code for it....n also would like to know how to interface it.....Pls do help me!!!!
The Kit used is CY8C55
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there ! Interfacing ADXL345 to PSoC5 is possible via I2C interface. Do you already know about I2C interface ? If not open the I2C component datasheet to get to know the PSoC side of things. And as far as ADXL345 is concerned, please go through the datasheet to understand various parameters, the datasheet is the best possible tutor. Your first task should be getting data in to PSoC from ADXL345, integrating the data comes later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using SPI interfacing and i have studied about SPI using its datasheet....And I have gone through parameters of ADXL 345......I would like to know whether there is a need of using analog device development board with ADXL345 for interface or just the sensor?? And i also have problem in writing the code for it??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you can use SPI to interface ADXL345 with PSoC3/PSoC5 device. You do not need any analog devices board for this. All you need is PSoC5 interfaced with ADXL345 via SPI bus. Have you installed PSoC Creator ? that would be the first step towards coding. You can download the latest version of Creator from here, http://www.cypress.com/?id=2494. I believe you already have a CY8CKit-001.
Please also check this page for basic tutorial on getting started with PSoC3, http://www.cypress.com/?id=2232&tabID=38386 . Once you are quite familiar with the PSoC Creator environment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes....I have the PSoc Creator 2.0.... n i have built 2 programs on LED blinking both using firmware and using clock....also i have built a code on using it as voltmeter using tutorial video.....what is the next step i can do??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great. Next... place an SPI component on the TopDesign (I assume you know what is Topdesign, if not ask us). You can find the SPI component in the DIGITAL -->COMMUNICATION COMPONENTS folder in the COMPONENT CATALOG. Open the datasheet and try to understand the basics of SPI component. Now right clock the component and click on "Find Example Project(code)". PSoC Creator will now find you an SPI code example. Go through this code and understand how it works. If you get past this stage, them next step is connecting PSoC to ADXL345. Do you have it already with you ? If yes in what form? Are the pins of ADXL345 accesible ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanku.....I ll go through it as soon as possible.....And I will let u know about the pins of ADXL 345
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I went through the code of example project on SPI.....I understood about the moving of data between Master & Slave....And the ADXL 345 pins r soldered on to the PCB....So i guess its not accessible.....What is the next step I can do??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I went through the code of example project on SPI.....I understood about the moving of data between Master & Slave....And the ADXL 345 pins r soldered on to the PCB....So i guess its not accessible.....What is the next step I can do??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi vineeths_04,
Are there pin outs on the board which will let you access the ADXL345 pins?
You must have access to the SPI communication lines, SCL, SDI, SDO, CS in order to communicate with the device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yess....i do have access to those pins
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's great !
Next you need to refer to the datasheet of ADXL345 to understand which registers you need to write to configure the mode of operation of the accelerometer. You can set the resolution and range using these registers.
You have to connect the SCL, SDI, SDO and CS pins of ADXL345 with that of PSoC. Write the necessary commands to configure the accelerometer and then read the X, Y and Z axis registers to get the acceleration values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you control th ss pin? how to read data in a multibyte mode?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SS(if you meant Slave select) line can be selected by using a dedicated pin that can be connected to the CS pin of the ADXL345. The CS line can be driven low by writing in the firmware before initiaiting any SPI transaction.