2003-08-28 11:08 PM
2003-08-26 10:52 PM
Hi,
I'm looking for a way to define the io pins of the st7lite0 as labels. that way i would be able to use a format like: LED = 1; LED = 0; a = LED; etc. Instead of: PADR = 0x08; PADR = 0x00; a = (PADR & 0x0 >> 3; etc. is there a way to do it under the Cosmic compiler? Thanks2003-08-27 08:41 PM
Hello,
You can use bitfields for your problem struct t { unsigned char bito:1; . . . unsigned char bit7:1; }; @tiny volatile struct t PA @address; #define LED PA.bit0 and so on you can define all the port bits But there is a problem in this solution. The code generated with this approach uses bset, breset assembly instructions which are not recommended for I/O port data registers. Hope this helps, Regards, PraveenG2003-08-28 11:08 PM
Hello Parveen,
bset, breset instructions can be used for I/O data registers but these has to be used with care when you are using the mixed configuaration for your port (like some as o/p & some as i/p). There is an FAQ available in the knowledgebase explaining how to use bit set & reset instructions. thanks jatin