Hi all, Does anyone know how test the state of the BIO pin on the expansion peripheral interface (for a C5402 DSK) using C. I know how to test it with assembly,ie " bc biohigh,bio ; wait till host sends request ;..... whole bunch of code biohigh " but placing my C code between the branch and 'biohigh' entry point doesnt work, Is it possible to use an if statement with BIO to then execute a whole bunch of C code. any help would be greatly appreciated. Andrew Pasquale |
|
testing BIO signal in C
Started by ●July 30, 2002
Reply by ●July 30, 20022002-07-30
andrew I couldn't find a direct way to do it in c since the state of the PIN is not avaliable via a register (At least that I could find). Look at TI's app note spra803. It has a quick simple c callable asm routine to do it. If there is a easer way I'd love to know it as well. Phil _CF_Present: LD #0, A ;Set return value to false BC not_inserted, NBIO ;BIO = 1 => CF not inserted correctly ;BIO = 0 => CF inserted correctly NOP NOP LD #1, A ;Set return value to true RET ;Card present, return normally not_inserted: ;Card not present RET ;exit --- andrewpasquale <> wrote: > Hi all, > Does anyone know how test the state of the BIO pin > on the expansion > peripheral interface (for a C5402 DSK) using C. I > know how to test it > with assembly,ie > " bc biohigh,bio ; wait till host sends > request > ;..... whole bunch of code > biohigh > " > but placing my C code between the branch and > 'biohigh' entry point > doesnt work, Is it possible to use an if statement > with BIO to then > execute a whole bunch of C code. > any help would be greatly appreciated. > Andrew Pasquale > > _____________________________________ > Note: If you do a simple "reply" with your email > client, only the author of this message will receive > your answer. You need to do a "reply all" if you > want your answer to be distributed to the entire > group. > > _____________________________________ > About this discussion group: > > To Join: Send an email to > To Post: Send an email to > > To Leave: Send an email to > Archives: http://www.yahoogroups.com/group/c54x > > Other Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ __________________________________________________ |
Reply by ●July 31, 20022002-07-31
Hi Andrew, Couple of ways: a) use the following lines in your C code. asm(" bc _biohigh, bio"); // note the underscore biohigh: b) Convoluted way, esp if you have more to do in assembly before testing for bio. write a function that returns 1 if bio is 1 etc and use if. regards vn > Date: Tue, 30 Jul 2002 05:15:41 -0000 > From: "andrewpasquale" > <> > Subject: testing BIO signal in C > > Hi all, > Does anyone know how test the state of the BIO pin > on the expansion > peripheral interface (for a C5402 DSK) using C. I > know how to test it > with assembly,ie > " bc biohigh,bio ; wait till host sends > request > ;..... whole bunch of code > biohigh > " > but placing my C code between the branch and > 'biohigh' entry point > doesnt work, Is it possible to use an if statement > with BIO to then > execute a whole bunch of C code. > any help would be greatly appreciated. > Andrew Pasquale > |