How to tell the micor to read from EEPROM in SSC32 ? Urgent

**hi everybody here …

how are u …how are u doing there…i hope everything is going very well with u there…

i want to use SSC32 to control my hexapod robot …i want to u use Ulterasoinc or Sharp IR as input to the board .So i need to use Micro (i use AVR atmega 32 or 16 ) to interface it with board .But the pro her i faced it was that i want to save my sequnces in the EEPROM …My qus is :

i want to save differnt sequnces (forward,backward ,others ) and save it
in different addresses in EEPROM … can i tell my micro if it reads high from senor to go and read sequnce value in that certain address in EEPROM and take action???

please if u know just tell me …it is urgent

regards

ahmed **

Is anybody here ??? :unamused: :unamused: :unamused:

apparently, in the last 12 hours or so since you asked, not anybody capable of answering your question. :unamused:

Ok …Can anybody tell how to interface micor with SSC3 since i want to use bluetooth in my board to commuicate with my pc …so how to tell the micor is it read high in the sensor , do this certain sequnce …as son on???

please replay if u know coz i need this in my frinal year project …and i stuck in this :unamused: :unamused: :unamused:

Not sure what your real question is here. (before 7:00am here)

From your question I am assuming that you are wanting to use the general purpose sequencer on the SSC-32 (lynxmotion.com/images/html/build137.htm) to run a different sequence depending on your sensor. The first step would be to use a program like SEQ to generate the sequences and to download them to your SSC-32. Note: the SSC-32 serial port would have to be connected to your PC either directly or possibly through bluetooth. Instructions for this are in the SSC-32 manual or for bluetooth in the forum. Once you have these sequences working the way you want, you would then switch the input lines of the SSC-32 away from your PC to be your micro.

But if your question is simply how to connect your microprocessor to the SSC-32 then you need to connect 1 or 2 IO lines from your micro to the SSC-32 TTL serial input lines.

On the SSC-32 side there is information in the SSC-32 users manual lynxmotion.com/images/html/build136.htm for this and you can look at several of the different tutorials on the website that shows this. Now on your ATMega16/32 (I will assume 16 for the rest of this as for the most part the only difference is memory size…) side this can be a little more fun. Atmega16s only have one hardware serial port. My guess is that you will end up using this to support the bluetooth. So you will probably have to use your own software to do the serial communication to the SSC-32. Awhile ago I used to interface a serial LCD to my Atmega32 and I had bit bang code for 9600 baud that looked something like:

[code]{
if (fHi)
m_pout->High();
else
m_pout->Low();

// Now need to wait a right time for 9600 baud...
// try looping enough times to use up the timer.
// need to check compiler output for final devisor... 6
_Delay((((unsigned short)(F_CPU/9600))-150)/6);	// try to convert to number of loops to wait. 35 approx cycles used elsewhere...

}

/* writes a character at the current location, updates
current location to next space (to right) */
void SerLCD::WriteCh(unsigned char ch) const
{
// Here is the workhorse.
int i;

// Need to first output the Start Bit
_WriteBit(true);

for (i=0;i<8;i++)
{
	// Output each bit
	_WriteBit((ch & 1)? false : true);
		
	ch = ch >> 1;
}

// Now output Stop Bit
_WriteBit(false);

// try a slight wait after each character

// m_ptimer->WaitMs(1);
}[/code]

Note: this might rely on some other support functions but should give you an idea…

Now assuming you have written code for the Atmega to read in the Sharp IR sensor using one of the ADC channels, you could simply take the values returned from the sensor and output a command to the SSC-32 through the serial port as mentioned above. For example if you have saved away the walk forward sequence starting at location 5 and through your sensor code you decide that is what you wish to do, then you would output the ASCII text of something like: “PL 0 SQ 5”, where the is a carraige return. The syntax for this command are in the general sequencer document I mentioned above.

I hope this helps, and Good Luck

Kurt

Hello ahmed,

The best way to ensure you get lots of help on the forum is to read and learn as much as possible on your own. Then post detailed questions on the specific topic that is still not clear. There are many resources for you to learn from. Many of your questions can be answered by reading the SSC-32 html manuals online.
lynxmotion.com/ViewPage.aspx … ID=70#serv

Good luck with your project. :smiley:

Thanks alot my friends …if i get stuck …just i will come to this great forum.

But my qu is that i want to use EEPROM to save my sequnces and i want to save that sequcnes in different location in EERPOM . I want the micro (AVR atmega 16 ) to read the value of sensor and (for exp) if it read high , go the ceratian address in EEPROM in SSC32 and run (for exp) forward sequnces

Can i do this or not ?

regards

ahmed

I thought I answered this in my first post. Yes this can be done. You need to break this down into simple steps. I am assuming that you have a new SSC-32 and it has an EEPROM plugged into it and you have a version of the SSC-32 which supports the general sequencer and you have a form of serial communication working between your PC and the SSC-32 board (ie serial cable or PS2 to Serial Adapter).

You can use the Lynx Terminal program to check out your card and to verify which version you are running. Again all of this is in the manual. If it is not the general sequencing version you can download it and update your card to it…

Now you need to generate your sequences. The easiest way is to use the program Lynxterm Visual Sequencer (SEQ) to generate the sequences. This program can be purchased from Lynxmotion. Other people have developed their own programs or in some cases Excel Spreadsheets to generate sequences as well. Once you have generated your sequences and stored them to the EEPROM on the SSC-32 and you are happy with how they work, you can now go to the next step.

You need to connect your Microprocessor to the SSC-32 serial input port. There are instructions on how to do this in the manual or in several other posts. Then from your microprocessor you can output a command in Ascii to run a specific sequence out of the EEPROM. Again you may have some complications as you may not have any hardware serial ports available to you on your microprocessor and as such you will/may have to emulate one in software.

You will need to write software on your microprocessor to read the inputs from whichever sensors you choose to hook up. Note: you can do this part of the work at any time (ie you can work on this and simply have your program output the values it receives to a serial terminal to help you debug it.

Once you have the sequences stored on the SSC-32 and working the way you want it and you have communication working betwwen the SSC-32 and your microprocessor and you have your sensors being read you can write the code to tie it all togeather and have some simple logic like:

If my sensor reads higher than some threshold, issue the go forward sequence. Else Issue the Turn or the go back or the… sequence. You would also probably have code that says if I am in the same mode as before I don’t need to reissue the code. Also you could have logic that depending on what the sensor is reading you could speed up or slow down the sequences. All of this is in the General Purpose Sequencer manual…

So the question is what have you tried and what specifically does not work for you?

Kurt

Untill now i dont have anythings in my hands (ssc32 ,sensors , and othres ) coz we havent order them yet !!! we are preparing for excepted and unexcepted things that will face us later …we should order them but thers is some delay and restrictions .

I want to ask …can Lynxmotoin order to Med-east (Oman)???

Yes we can ship to Oman. :wink:

I forget to thanks Kurte …Thanks alot man :smiley: :smiley: :smiley: … my freiend called me asking machine !!! so i hope u will not suffer alot with me :laughing:

also …how much it will cost me to order SSC32 and SSC32 sequncer + shipping cost ???