Jump to content
43oh

voodoofish

Members
  • Content Count

    45
  • Joined

  • Last visited

  • Days Won

    4

Reputation Activity

  1. Like
    voodoofish reacted to bluehash in Data Logger board   
    viewtopic.php?f=35&t=2184
  2. Like
    voodoofish got a reaction from shluzzzoid in Data Logger board   
    Data Logger module.
    Renamed from data recorder since it just didn't sound correct.
     
    I worked on this over the weekend as I was looking to create something simple for a(the main)project I've been working on. I was thinking it would be something similar in features(though a little more) to the uLogger that SF sells in that it stores readings to a mem chip and was small. I could see this being useful for some projects.
     
    I was hoping to get a once over(feedback) on it to see if anything overtly wrong could be spotted. As far as I can tell, everything looks good and it should work as expected(HA! right...never happens.)
    This is pretty tightly packed as well...so....maybe too packed? Let me know what ya think!
     
    uProc 2X53 (current version using a G2353)
    Features:
    pinout for programming
    pinout for external parts
    header with uart and acd/CA channels broken out. (additional pluggable module is going to be in the works next to utilize the header.)
    external memory chip with 1mbit storage(other options available)
    3 status LEDs
    3.3v vreg onboard.
    jumper to set reset/alt button.
     
    The only thing I don't have broken out atm are the xtal pins....though I planned on having at least one broken out.
     
     

  3. Like
    voodoofish reacted to RobG in Data Logger board   
    Nice! BTW, C6 should be 1nF.
  4. Like
    voodoofish got a reaction from gatImmusepete in 25AA320A SPI eeprom read and write   
    schematic for the board. someone was asking on irc so figured I'd post it here. It could look better.... :|

  5. Like
    voodoofish got a reaction from bluehash in 25AA320A SPI eeprom read and write   
    schematic for the board. someone was asking on irc so figured I'd post it here. It could look better.... :|

  6. Like
    voodoofish got a reaction from gwdeveloper in 25AA320A SPI eeprom read and write   
    schematic for the board. someone was asking on irc so figured I'd post it here. It could look better.... :|

  7. Like
    voodoofish got a reaction from smooth_penguin in 25AA320A SPI eeprom read and write   
    schematic for the board. someone was asking on irc so figured I'd post it here. It could look better.... :|

  8. Like
    voodoofish got a reaction from bluehash in Parallax RFID reader v2   
    I didn't want to take away from NatureTM's post on a similar title, so I'm just calling this v2.
     
    This is my version of the parallax RFID Reader code. I'm using oPossum's software asyncserial code as the base for communications as it was extremely small and just worked right out of the box. The code currently compiles to Text: 608 bytes and Data 100 bytes. This is running on the 2231 chip but I'm sure would run fine on the 2211 as well.
     
    Pins used, VCC for power to the RFID reader, GND for ground, P1.4 for serial in and P1.0 for enable/disable of the reader.
     
    The brief on it:
    1. read RFID
    2. Disable RFID reader
    3. Output matches and mismatches
    4. Add small Delay(I did this as an experiment in learning ASM so not sure if this is the best way to do it. I could have used a simple delay function written in c which would have made control of the delay a little easier to set. )
    5. turn on Reader
     
    Now step 3 can be modified to just output if it matches or not....but I didn't do that with this code.
    I've also added a couple of functions to the serial.asm file that turn on and off the Red LED P1.0 and another wait function....Seeing as I'm not quite sure if I did this correct or not...I'm sure someone may spot issues.
     
    I tried my hand at a simple diff function....I'm sure it could be better as well...but heck, it worked for me so far...I'd love to hear recommendations on it.
    EDIT: depending on your system this may not work on the linux side right away....I forgot that the code for the button press was important in that if you just plug this in it'll play havoc with some serial ports...so...you need a delay or set the first transmit of the device within the button interrupt....ooops...

    Main body of code...

    // RFidRead.c #include "msp430g2231.h" //change as needed #define keyCount 3 #define idc 11 static const unsigned char ID[][12] = { {0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x31, 0x33, 0x42, 0x0D} // 0F0302813B ,{0x0A, 0x30, 0x34, 0x31, 0x35, 0x42, 0x30, 0x43, 0x34, 0x34, 0x34, 0x0D} // 0415B0C444 ,{0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x30, 0x35, 0x31, 0x0D} // 0F03028051 }; // oPossums function code void serial_setup(unsigned out_mask, unsigned in_mask, unsigned duration); void putc(unsigned); void puts(char *); unsigned getc(void); //new functions to enable and disable the Red LED void Red_Off(void); void Red_On(void); void Wait(void); //my diff funciton. var 1 is the input key(read in from the rfid reader), var 2 is the diff key from the ID Array. unsigned char diffAR(unsigned char a[],const unsigned char b[]); void main(void) { unsigned char key[12]; //array to hold keys read in through reader // Disable watchdog WDTCTL = WDTPW + WDTHOLD; //disabled as I now just put this code into a loop without initialization via button press //P1IE = 0x04; // P1.3 interrupt enabled //P1IES |= 0x04; // P1.3 Hi/lo edge //P1IFG &= ~0x04; // P1.3 IFG cleared // Use 1 MHz DCO factory calibration DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; //I'm wondering if it's possible to set up 3 pins for serial com.... // Setup the serial port // Serial out: P1.1 (BIT1) // Serial in: P1.4 (BIT2) // Bit rate: 2400 (CPU freq / bit rate) serial_setup(BIT1, BIT4, 1000000 / 2400); //Start of read code. puts("\r\nRFID Read...\r\n"); //if data comes out garbled check the baud rate....try hitting reset as well. //_BIS_SR(LPM0_bits + GIE); //disabling for now as I don't need this. while(1){ int i; for(i = 0;i<11;i++) { // Do forever //c = getc(); // Get a char key[i]=getc(); //putc(c); // Echo it back } Red_On(); //Check for 0F or 04 for(i = 0;i<11;i++) { putc(key[i]); } puts("\r\n"); int x; for(x=0;x if (diffAR(key, ID[x])==1) {puts("\r\nKey matches...\r\n");} else {puts("\r\nKey mismatch...\r\n");} } //Some test code...figured maybe it would be useful for someone. /* for(; { // Do forever c = getc(); // Get a char switch(c) { case 'a' : putc(c); Red_On(); break; case 'b' : putc(c); Red_Off(); break; default : putc(c); Red_Off(); } } */ Wait(); //wait for a little bit. Red_Off(); //Re-enable RFID reader. } } //not used atm, left in just in case though... #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { char c; c = getc(); putc(c); P1IFG &= ~0x04; // P1.3 IFG cleared } unsigned char diffAR(unsigned char a[],const unsigned char b[]){ unsigned char diff = 0; unsigned char t = 0; unsigned char count = 0; unsigned char i; for(i = 0;i<11;i++) { putc(b[i]); } //A do while loop...WOO... do { //compare arrays here t=(b[count]==a[count])? 1:0; count++; if (count == 11) {diff = 1;} } while(t == 1); //a=(x==y)? 1:0; return diff; }
     
    And the slightly modified code from oPossum

    ; serial.asm .cdecls C, LIST, "msp430g2231.h" .bss in_bit_mask, 2 ; Serial in pin .bss out_bit_mask, 2 ; Serial out pin .bss bit_dur, 2 ; Bit duration in cycles .bss half_dur, 2 ; Half bit duration in cycles ; .text ; .def serial_setup ; void serial_setup(unsigned out_mask, unsigned in_mask, unsigned bit_duration); .def putc ; void putc(unsigned c); .def puts ; void puts(char *s); .def getc ; unsigned getc(void); .def Red_On ; .def Red_Off ; .def Wait ; ; serial_setup ; - Setup serial I/O bitmasks and bit duration (32 minimum) mov R12, &out_bit_mask ; Save serial output bitmask mov R13, &in_bit_mask ; Save serial input bitmask bis R12, &P1DIR ; Setup output pin bis R12, &P1OUT ; bic R13, &P1DIR ; Setup input pin or R13, R12 ; bic R12, &P1SEL ; Setup peripheral select mov R14, R12 ; sub #16, R14 ; Adjust count for loop overhead rla R14 ; Multiply by 2 because NOP is two bytes mov R14, &bit_dur ; Save bit duration sub #32, R12 ; Adjust count for loop overhead mov R12, &half_dur ; Save half bit duration ; Added by mark to allow for LED fun! bis.b #01000001b,&P1DIR ; make P1.0 and P1.6 output jmp Red_Off ; all others are inputs by default ret ; Return ; ; - Send a single char putc ; Char to tx in R12 ; R12, R13, R14, R15 trashed mov &out_bit_mask, R15 ; Serial output bitmask mov &bit_dur, R14 ; Bit duration or #0x0300, R12 ; Stop bit(s) jmp bit_low ; Send start bit... ; tx_bit mov R14, R13 ; Get bit duration tx_delay nop ; 4 cycle loop sub #8, R13 ; jc tx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; rra R12 ; Get bit to tx, test for zero jc bit_high ; If high... bit_low bic.b R15, &P1OUT ; Send zero bit jmp tx_bit ; Next bit... bit_high bis.b R15, &P1OUT ; Send one bit jnz tx_bit ; If tx data is not zero, then there are more bits to send... ; ret ; Return when all bits sent ; ; ; - Send a NULL terminated string puts ; Tx string using putc push R11 ; mov R12, R11 ; String pointer in R12, copy to R11 putsloop ; mov.b @R11+, R12 ; Get a byte, inc pointer tst.b R12 ; Test if end of string jz putsx ; Yes, exit... call #putc ; Call putc jmp putsloop ; putsx pop R11 ; ret ; ; getc ; - Get a char mov &bit_dur, R14 ; Bit duration mov &in_bit_mask, R13 ; Input bitmask mov #0x01FF, R12 ; 9 bits - 8 data + stop rx_start ; Wait for start bit mov &P1IN, R15 ; Get serial input and R13, R15 ; Mask and test bit jc rx_start ; Wait for low... ; mov &half_dur, R13 ; Wait for 1/2 bit time ; rx_delay nop ; Bit delay sub #8, R13 ; jc rx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; mov &P1IN, R15 ; Get serial input and &in_bit_mask, R15 ; rrc R12 ; Shift in a bit ; mov R14, R13 ; Setup bit timer jc rx_delay ; Next bit... ; rla R12 ; Move stop bit to carry swpb R12 ; Move rx byte to lower byte, start bit in msb ret ; Return with rx char and start bit in R12, stop bit in carry ; ; Added by Mark Red_On bis.b #00000001b,&P1OUT ; set P1.6 (green on) ret ; Red_Off bic.b #00000001b,&P1OUT ; set P1.0 (red on) ret Wait mov.w #31834,R10 ; load R10 with value for delay L1 dec.w R10 ; decrement R10 jnz L1 ; if R10 is not zero jump to L1 ret .end ;
  9. Like
    voodoofish got a reaction from oPossum in Parallax RFID reader v2   
    I didn't want to take away from NatureTM's post on a similar title, so I'm just calling this v2.
     
    This is my version of the parallax RFID Reader code. I'm using oPossum's software asyncserial code as the base for communications as it was extremely small and just worked right out of the box. The code currently compiles to Text: 608 bytes and Data 100 bytes. This is running on the 2231 chip but I'm sure would run fine on the 2211 as well.
     
    Pins used, VCC for power to the RFID reader, GND for ground, P1.4 for serial in and P1.0 for enable/disable of the reader.
     
    The brief on it:
    1. read RFID
    2. Disable RFID reader
    3. Output matches and mismatches
    4. Add small Delay(I did this as an experiment in learning ASM so not sure if this is the best way to do it. I could have used a simple delay function written in c which would have made control of the delay a little easier to set. )
    5. turn on Reader
     
    Now step 3 can be modified to just output if it matches or not....but I didn't do that with this code.
    I've also added a couple of functions to the serial.asm file that turn on and off the Red LED P1.0 and another wait function....Seeing as I'm not quite sure if I did this correct or not...I'm sure someone may spot issues.
     
    I tried my hand at a simple diff function....I'm sure it could be better as well...but heck, it worked for me so far...I'd love to hear recommendations on it.
    EDIT: depending on your system this may not work on the linux side right away....I forgot that the code for the button press was important in that if you just plug this in it'll play havoc with some serial ports...so...you need a delay or set the first transmit of the device within the button interrupt....ooops...

    Main body of code...

    // RFidRead.c #include "msp430g2231.h" //change as needed #define keyCount 3 #define idc 11 static const unsigned char ID[][12] = { {0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x31, 0x33, 0x42, 0x0D} // 0F0302813B ,{0x0A, 0x30, 0x34, 0x31, 0x35, 0x42, 0x30, 0x43, 0x34, 0x34, 0x34, 0x0D} // 0415B0C444 ,{0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x30, 0x35, 0x31, 0x0D} // 0F03028051 }; // oPossums function code void serial_setup(unsigned out_mask, unsigned in_mask, unsigned duration); void putc(unsigned); void puts(char *); unsigned getc(void); //new functions to enable and disable the Red LED void Red_Off(void); void Red_On(void); void Wait(void); //my diff funciton. var 1 is the input key(read in from the rfid reader), var 2 is the diff key from the ID Array. unsigned char diffAR(unsigned char a[],const unsigned char b[]); void main(void) { unsigned char key[12]; //array to hold keys read in through reader // Disable watchdog WDTCTL = WDTPW + WDTHOLD; //disabled as I now just put this code into a loop without initialization via button press //P1IE = 0x04; // P1.3 interrupt enabled //P1IES |= 0x04; // P1.3 Hi/lo edge //P1IFG &= ~0x04; // P1.3 IFG cleared // Use 1 MHz DCO factory calibration DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; //I'm wondering if it's possible to set up 3 pins for serial com.... // Setup the serial port // Serial out: P1.1 (BIT1) // Serial in: P1.4 (BIT2) // Bit rate: 2400 (CPU freq / bit rate) serial_setup(BIT1, BIT4, 1000000 / 2400); //Start of read code. puts("\r\nRFID Read...\r\n"); //if data comes out garbled check the baud rate....try hitting reset as well. //_BIS_SR(LPM0_bits + GIE); //disabling for now as I don't need this. while(1){ int i; for(i = 0;i<11;i++) { // Do forever //c = getc(); // Get a char key[i]=getc(); //putc(c); // Echo it back } Red_On(); //Check for 0F or 04 for(i = 0;i<11;i++) { putc(key[i]); } puts("\r\n"); int x; for(x=0;x if (diffAR(key, ID[x])==1) {puts("\r\nKey matches...\r\n");} else {puts("\r\nKey mismatch...\r\n");} } //Some test code...figured maybe it would be useful for someone. /* for(; { // Do forever c = getc(); // Get a char switch(c) { case 'a' : putc(c); Red_On(); break; case 'b' : putc(c); Red_Off(); break; default : putc(c); Red_Off(); } } */ Wait(); //wait for a little bit. Red_Off(); //Re-enable RFID reader. } } //not used atm, left in just in case though... #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { char c; c = getc(); putc(c); P1IFG &= ~0x04; // P1.3 IFG cleared } unsigned char diffAR(unsigned char a[],const unsigned char b[]){ unsigned char diff = 0; unsigned char t = 0; unsigned char count = 0; unsigned char i; for(i = 0;i<11;i++) { putc(b[i]); } //A do while loop...WOO... do { //compare arrays here t=(b[count]==a[count])? 1:0; count++; if (count == 11) {diff = 1;} } while(t == 1); //a=(x==y)? 1:0; return diff; }
     
    And the slightly modified code from oPossum

    ; serial.asm .cdecls C, LIST, "msp430g2231.h" .bss in_bit_mask, 2 ; Serial in pin .bss out_bit_mask, 2 ; Serial out pin .bss bit_dur, 2 ; Bit duration in cycles .bss half_dur, 2 ; Half bit duration in cycles ; .text ; .def serial_setup ; void serial_setup(unsigned out_mask, unsigned in_mask, unsigned bit_duration); .def putc ; void putc(unsigned c); .def puts ; void puts(char *s); .def getc ; unsigned getc(void); .def Red_On ; .def Red_Off ; .def Wait ; ; serial_setup ; - Setup serial I/O bitmasks and bit duration (32 minimum) mov R12, &out_bit_mask ; Save serial output bitmask mov R13, &in_bit_mask ; Save serial input bitmask bis R12, &P1DIR ; Setup output pin bis R12, &P1OUT ; bic R13, &P1DIR ; Setup input pin or R13, R12 ; bic R12, &P1SEL ; Setup peripheral select mov R14, R12 ; sub #16, R14 ; Adjust count for loop overhead rla R14 ; Multiply by 2 because NOP is two bytes mov R14, &bit_dur ; Save bit duration sub #32, R12 ; Adjust count for loop overhead mov R12, &half_dur ; Save half bit duration ; Added by mark to allow for LED fun! bis.b #01000001b,&P1DIR ; make P1.0 and P1.6 output jmp Red_Off ; all others are inputs by default ret ; Return ; ; - Send a single char putc ; Char to tx in R12 ; R12, R13, R14, R15 trashed mov &out_bit_mask, R15 ; Serial output bitmask mov &bit_dur, R14 ; Bit duration or #0x0300, R12 ; Stop bit(s) jmp bit_low ; Send start bit... ; tx_bit mov R14, R13 ; Get bit duration tx_delay nop ; 4 cycle loop sub #8, R13 ; jc tx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; rra R12 ; Get bit to tx, test for zero jc bit_high ; If high... bit_low bic.b R15, &P1OUT ; Send zero bit jmp tx_bit ; Next bit... bit_high bis.b R15, &P1OUT ; Send one bit jnz tx_bit ; If tx data is not zero, then there are more bits to send... ; ret ; Return when all bits sent ; ; ; - Send a NULL terminated string puts ; Tx string using putc push R11 ; mov R12, R11 ; String pointer in R12, copy to R11 putsloop ; mov.b @R11+, R12 ; Get a byte, inc pointer tst.b R12 ; Test if end of string jz putsx ; Yes, exit... call #putc ; Call putc jmp putsloop ; putsx pop R11 ; ret ; ; getc ; - Get a char mov &bit_dur, R14 ; Bit duration mov &in_bit_mask, R13 ; Input bitmask mov #0x01FF, R12 ; 9 bits - 8 data + stop rx_start ; Wait for start bit mov &P1IN, R15 ; Get serial input and R13, R15 ; Mask and test bit jc rx_start ; Wait for low... ; mov &half_dur, R13 ; Wait for 1/2 bit time ; rx_delay nop ; Bit delay sub #8, R13 ; jc rx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; mov &P1IN, R15 ; Get serial input and &in_bit_mask, R15 ; rrc R12 ; Shift in a bit ; mov R14, R13 ; Setup bit timer jc rx_delay ; Next bit... ; rla R12 ; Move stop bit to carry swpb R12 ; Move rx byte to lower byte, start bit in msb ret ; Return with rx char and start bit in R12, stop bit in carry ; ; Added by Mark Red_On bis.b #00000001b,&P1OUT ; set P1.6 (green on) ret ; Red_Off bic.b #00000001b,&P1OUT ; set P1.0 (red on) ret Wait mov.w #31834,R10 ; load R10 with value for delay L1 dec.w R10 ; decrement R10 jnz L1 ; if R10 is not zero jump to L1 ret .end ;
  10. Like
    voodoofish got a reaction from RobG in Parallax RFID reader v2   
    I didn't want to take away from NatureTM's post on a similar title, so I'm just calling this v2.
     
    This is my version of the parallax RFID Reader code. I'm using oPossum's software asyncserial code as the base for communications as it was extremely small and just worked right out of the box. The code currently compiles to Text: 608 bytes and Data 100 bytes. This is running on the 2231 chip but I'm sure would run fine on the 2211 as well.
     
    Pins used, VCC for power to the RFID reader, GND for ground, P1.4 for serial in and P1.0 for enable/disable of the reader.
     
    The brief on it:
    1. read RFID
    2. Disable RFID reader
    3. Output matches and mismatches
    4. Add small Delay(I did this as an experiment in learning ASM so not sure if this is the best way to do it. I could have used a simple delay function written in c which would have made control of the delay a little easier to set. )
    5. turn on Reader
     
    Now step 3 can be modified to just output if it matches or not....but I didn't do that with this code.
    I've also added a couple of functions to the serial.asm file that turn on and off the Red LED P1.0 and another wait function....Seeing as I'm not quite sure if I did this correct or not...I'm sure someone may spot issues.
     
    I tried my hand at a simple diff function....I'm sure it could be better as well...but heck, it worked for me so far...I'd love to hear recommendations on it.
    EDIT: depending on your system this may not work on the linux side right away....I forgot that the code for the button press was important in that if you just plug this in it'll play havoc with some serial ports...so...you need a delay or set the first transmit of the device within the button interrupt....ooops...

    Main body of code...

    // RFidRead.c #include "msp430g2231.h" //change as needed #define keyCount 3 #define idc 11 static const unsigned char ID[][12] = { {0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x31, 0x33, 0x42, 0x0D} // 0F0302813B ,{0x0A, 0x30, 0x34, 0x31, 0x35, 0x42, 0x30, 0x43, 0x34, 0x34, 0x34, 0x0D} // 0415B0C444 ,{0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x30, 0x35, 0x31, 0x0D} // 0F03028051 }; // oPossums function code void serial_setup(unsigned out_mask, unsigned in_mask, unsigned duration); void putc(unsigned); void puts(char *); unsigned getc(void); //new functions to enable and disable the Red LED void Red_Off(void); void Red_On(void); void Wait(void); //my diff funciton. var 1 is the input key(read in from the rfid reader), var 2 is the diff key from the ID Array. unsigned char diffAR(unsigned char a[],const unsigned char b[]); void main(void) { unsigned char key[12]; //array to hold keys read in through reader // Disable watchdog WDTCTL = WDTPW + WDTHOLD; //disabled as I now just put this code into a loop without initialization via button press //P1IE = 0x04; // P1.3 interrupt enabled //P1IES |= 0x04; // P1.3 Hi/lo edge //P1IFG &= ~0x04; // P1.3 IFG cleared // Use 1 MHz DCO factory calibration DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; //I'm wondering if it's possible to set up 3 pins for serial com.... // Setup the serial port // Serial out: P1.1 (BIT1) // Serial in: P1.4 (BIT2) // Bit rate: 2400 (CPU freq / bit rate) serial_setup(BIT1, BIT4, 1000000 / 2400); //Start of read code. puts("\r\nRFID Read...\r\n"); //if data comes out garbled check the baud rate....try hitting reset as well. //_BIS_SR(LPM0_bits + GIE); //disabling for now as I don't need this. while(1){ int i; for(i = 0;i<11;i++) { // Do forever //c = getc(); // Get a char key[i]=getc(); //putc(c); // Echo it back } Red_On(); //Check for 0F or 04 for(i = 0;i<11;i++) { putc(key[i]); } puts("\r\n"); int x; for(x=0;x if (diffAR(key, ID[x])==1) {puts("\r\nKey matches...\r\n");} else {puts("\r\nKey mismatch...\r\n");} } //Some test code...figured maybe it would be useful for someone. /* for(; { // Do forever c = getc(); // Get a char switch(c) { case 'a' : putc(c); Red_On(); break; case 'b' : putc(c); Red_Off(); break; default : putc(c); Red_Off(); } } */ Wait(); //wait for a little bit. Red_Off(); //Re-enable RFID reader. } } //not used atm, left in just in case though... #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { char c; c = getc(); putc(c); P1IFG &= ~0x04; // P1.3 IFG cleared } unsigned char diffAR(unsigned char a[],const unsigned char b[]){ unsigned char diff = 0; unsigned char t = 0; unsigned char count = 0; unsigned char i; for(i = 0;i<11;i++) { putc(b[i]); } //A do while loop...WOO... do { //compare arrays here t=(b[count]==a[count])? 1:0; count++; if (count == 11) {diff = 1;} } while(t == 1); //a=(x==y)? 1:0; return diff; }
     
    And the slightly modified code from oPossum

    ; serial.asm .cdecls C, LIST, "msp430g2231.h" .bss in_bit_mask, 2 ; Serial in pin .bss out_bit_mask, 2 ; Serial out pin .bss bit_dur, 2 ; Bit duration in cycles .bss half_dur, 2 ; Half bit duration in cycles ; .text ; .def serial_setup ; void serial_setup(unsigned out_mask, unsigned in_mask, unsigned bit_duration); .def putc ; void putc(unsigned c); .def puts ; void puts(char *s); .def getc ; unsigned getc(void); .def Red_On ; .def Red_Off ; .def Wait ; ; serial_setup ; - Setup serial I/O bitmasks and bit duration (32 minimum) mov R12, &out_bit_mask ; Save serial output bitmask mov R13, &in_bit_mask ; Save serial input bitmask bis R12, &P1DIR ; Setup output pin bis R12, &P1OUT ; bic R13, &P1DIR ; Setup input pin or R13, R12 ; bic R12, &P1SEL ; Setup peripheral select mov R14, R12 ; sub #16, R14 ; Adjust count for loop overhead rla R14 ; Multiply by 2 because NOP is two bytes mov R14, &bit_dur ; Save bit duration sub #32, R12 ; Adjust count for loop overhead mov R12, &half_dur ; Save half bit duration ; Added by mark to allow for LED fun! bis.b #01000001b,&P1DIR ; make P1.0 and P1.6 output jmp Red_Off ; all others are inputs by default ret ; Return ; ; - Send a single char putc ; Char to tx in R12 ; R12, R13, R14, R15 trashed mov &out_bit_mask, R15 ; Serial output bitmask mov &bit_dur, R14 ; Bit duration or #0x0300, R12 ; Stop bit(s) jmp bit_low ; Send start bit... ; tx_bit mov R14, R13 ; Get bit duration tx_delay nop ; 4 cycle loop sub #8, R13 ; jc tx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; rra R12 ; Get bit to tx, test for zero jc bit_high ; If high... bit_low bic.b R15, &P1OUT ; Send zero bit jmp tx_bit ; Next bit... bit_high bis.b R15, &P1OUT ; Send one bit jnz tx_bit ; If tx data is not zero, then there are more bits to send... ; ret ; Return when all bits sent ; ; ; - Send a NULL terminated string puts ; Tx string using putc push R11 ; mov R12, R11 ; String pointer in R12, copy to R11 putsloop ; mov.b @R11+, R12 ; Get a byte, inc pointer tst.b R12 ; Test if end of string jz putsx ; Yes, exit... call #putc ; Call putc jmp putsloop ; putsx pop R11 ; ret ; ; getc ; - Get a char mov &bit_dur, R14 ; Bit duration mov &in_bit_mask, R13 ; Input bitmask mov #0x01FF, R12 ; 9 bits - 8 data + stop rx_start ; Wait for start bit mov &P1IN, R15 ; Get serial input and R13, R15 ; Mask and test bit jc rx_start ; Wait for low... ; mov &half_dur, R13 ; Wait for 1/2 bit time ; rx_delay nop ; Bit delay sub #8, R13 ; jc rx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; mov &P1IN, R15 ; Get serial input and &in_bit_mask, R15 ; rrc R12 ; Shift in a bit ; mov R14, R13 ; Setup bit timer jc rx_delay ; Next bit... ; rla R12 ; Move stop bit to carry swpb R12 ; Move rx byte to lower byte, start bit in msb ret ; Return with rx char and start bit in R12, stop bit in carry ; ; Added by Mark Red_On bis.b #00000001b,&P1OUT ; set P1.6 (green on) ret ; Red_Off bic.b #00000001b,&P1OUT ; set P1.0 (red on) ret Wait mov.w #31834,R10 ; load R10 with value for delay L1 dec.w R10 ; decrement R10 jnz L1 ; if R10 is not zero jump to L1 ret .end ;
  11. Like
    voodoofish got a reaction from Rickta59 in Parallax RFID reader v2   
    I didn't want to take away from NatureTM's post on a similar title, so I'm just calling this v2.
     
    This is my version of the parallax RFID Reader code. I'm using oPossum's software asyncserial code as the base for communications as it was extremely small and just worked right out of the box. The code currently compiles to Text: 608 bytes and Data 100 bytes. This is running on the 2231 chip but I'm sure would run fine on the 2211 as well.
     
    Pins used, VCC for power to the RFID reader, GND for ground, P1.4 for serial in and P1.0 for enable/disable of the reader.
     
    The brief on it:
    1. read RFID
    2. Disable RFID reader
    3. Output matches and mismatches
    4. Add small Delay(I did this as an experiment in learning ASM so not sure if this is the best way to do it. I could have used a simple delay function written in c which would have made control of the delay a little easier to set. )
    5. turn on Reader
     
    Now step 3 can be modified to just output if it matches or not....but I didn't do that with this code.
    I've also added a couple of functions to the serial.asm file that turn on and off the Red LED P1.0 and another wait function....Seeing as I'm not quite sure if I did this correct or not...I'm sure someone may spot issues.
     
    I tried my hand at a simple diff function....I'm sure it could be better as well...but heck, it worked for me so far...I'd love to hear recommendations on it.
    EDIT: depending on your system this may not work on the linux side right away....I forgot that the code for the button press was important in that if you just plug this in it'll play havoc with some serial ports...so...you need a delay or set the first transmit of the device within the button interrupt....ooops...

    Main body of code...

    // RFidRead.c #include "msp430g2231.h" //change as needed #define keyCount 3 #define idc 11 static const unsigned char ID[][12] = { {0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x31, 0x33, 0x42, 0x0D} // 0F0302813B ,{0x0A, 0x30, 0x34, 0x31, 0x35, 0x42, 0x30, 0x43, 0x34, 0x34, 0x34, 0x0D} // 0415B0C444 ,{0x0A, 0x30, 0x46, 0x30, 0x33, 0x30, 0x32, 0x38, 0x30, 0x35, 0x31, 0x0D} // 0F03028051 }; // oPossums function code void serial_setup(unsigned out_mask, unsigned in_mask, unsigned duration); void putc(unsigned); void puts(char *); unsigned getc(void); //new functions to enable and disable the Red LED void Red_Off(void); void Red_On(void); void Wait(void); //my diff funciton. var 1 is the input key(read in from the rfid reader), var 2 is the diff key from the ID Array. unsigned char diffAR(unsigned char a[],const unsigned char b[]); void main(void) { unsigned char key[12]; //array to hold keys read in through reader // Disable watchdog WDTCTL = WDTPW + WDTHOLD; //disabled as I now just put this code into a loop without initialization via button press //P1IE = 0x04; // P1.3 interrupt enabled //P1IES |= 0x04; // P1.3 Hi/lo edge //P1IFG &= ~0x04; // P1.3 IFG cleared // Use 1 MHz DCO factory calibration DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; //I'm wondering if it's possible to set up 3 pins for serial com.... // Setup the serial port // Serial out: P1.1 (BIT1) // Serial in: P1.4 (BIT2) // Bit rate: 2400 (CPU freq / bit rate) serial_setup(BIT1, BIT4, 1000000 / 2400); //Start of read code. puts("\r\nRFID Read...\r\n"); //if data comes out garbled check the baud rate....try hitting reset as well. //_BIS_SR(LPM0_bits + GIE); //disabling for now as I don't need this. while(1){ int i; for(i = 0;i<11;i++) { // Do forever //c = getc(); // Get a char key[i]=getc(); //putc(c); // Echo it back } Red_On(); //Check for 0F or 04 for(i = 0;i<11;i++) { putc(key[i]); } puts("\r\n"); int x; for(x=0;x if (diffAR(key, ID[x])==1) {puts("\r\nKey matches...\r\n");} else {puts("\r\nKey mismatch...\r\n");} } //Some test code...figured maybe it would be useful for someone. /* for(; { // Do forever c = getc(); // Get a char switch(c) { case 'a' : putc(c); Red_On(); break; case 'b' : putc(c); Red_Off(); break; default : putc(c); Red_Off(); } } */ Wait(); //wait for a little bit. Red_Off(); //Re-enable RFID reader. } } //not used atm, left in just in case though... #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { char c; c = getc(); putc(c); P1IFG &= ~0x04; // P1.3 IFG cleared } unsigned char diffAR(unsigned char a[],const unsigned char b[]){ unsigned char diff = 0; unsigned char t = 0; unsigned char count = 0; unsigned char i; for(i = 0;i<11;i++) { putc(b[i]); } //A do while loop...WOO... do { //compare arrays here t=(b[count]==a[count])? 1:0; count++; if (count == 11) {diff = 1;} } while(t == 1); //a=(x==y)? 1:0; return diff; }
     
    And the slightly modified code from oPossum

    ; serial.asm .cdecls C, LIST, "msp430g2231.h" .bss in_bit_mask, 2 ; Serial in pin .bss out_bit_mask, 2 ; Serial out pin .bss bit_dur, 2 ; Bit duration in cycles .bss half_dur, 2 ; Half bit duration in cycles ; .text ; .def serial_setup ; void serial_setup(unsigned out_mask, unsigned in_mask, unsigned bit_duration); .def putc ; void putc(unsigned c); .def puts ; void puts(char *s); .def getc ; unsigned getc(void); .def Red_On ; .def Red_Off ; .def Wait ; ; serial_setup ; - Setup serial I/O bitmasks and bit duration (32 minimum) mov R12, &out_bit_mask ; Save serial output bitmask mov R13, &in_bit_mask ; Save serial input bitmask bis R12, &P1DIR ; Setup output pin bis R12, &P1OUT ; bic R13, &P1DIR ; Setup input pin or R13, R12 ; bic R12, &P1SEL ; Setup peripheral select mov R14, R12 ; sub #16, R14 ; Adjust count for loop overhead rla R14 ; Multiply by 2 because NOP is two bytes mov R14, &bit_dur ; Save bit duration sub #32, R12 ; Adjust count for loop overhead mov R12, &half_dur ; Save half bit duration ; Added by mark to allow for LED fun! bis.b #01000001b,&P1DIR ; make P1.0 and P1.6 output jmp Red_Off ; all others are inputs by default ret ; Return ; ; - Send a single char putc ; Char to tx in R12 ; R12, R13, R14, R15 trashed mov &out_bit_mask, R15 ; Serial output bitmask mov &bit_dur, R14 ; Bit duration or #0x0300, R12 ; Stop bit(s) jmp bit_low ; Send start bit... ; tx_bit mov R14, R13 ; Get bit duration tx_delay nop ; 4 cycle loop sub #8, R13 ; jc tx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; rra R12 ; Get bit to tx, test for zero jc bit_high ; If high... bit_low bic.b R15, &P1OUT ; Send zero bit jmp tx_bit ; Next bit... bit_high bis.b R15, &P1OUT ; Send one bit jnz tx_bit ; If tx data is not zero, then there are more bits to send... ; ret ; Return when all bits sent ; ; ; - Send a NULL terminated string puts ; Tx string using putc push R11 ; mov R12, R11 ; String pointer in R12, copy to R11 putsloop ; mov.b @R11+, R12 ; Get a byte, inc pointer tst.b R12 ; Test if end of string jz putsx ; Yes, exit... call #putc ; Call putc jmp putsloop ; putsx pop R11 ; ret ; ; getc ; - Get a char mov &bit_dur, R14 ; Bit duration mov &in_bit_mask, R13 ; Input bitmask mov #0x01FF, R12 ; 9 bits - 8 data + stop rx_start ; Wait for start bit mov &P1IN, R15 ; Get serial input and R13, R15 ; Mask and test bit jc rx_start ; Wait for low... ; mov &half_dur, R13 ; Wait for 1/2 bit time ; rx_delay nop ; Bit delay sub #8, R13 ; jc rx_delay ; subc R13, PC ; 0 to 3 cycle delay nop ; 3 nop ; 2 nop ; 1 ; mov &P1IN, R15 ; Get serial input and &in_bit_mask, R15 ; rrc R12 ; Shift in a bit ; mov R14, R13 ; Setup bit timer jc rx_delay ; Next bit... ; rla R12 ; Move stop bit to carry swpb R12 ; Move rx byte to lower byte, start bit in msb ret ; Return with rx char and start bit in R12, stop bit in carry ; ; Added by Mark Red_On bis.b #00000001b,&P1OUT ; set P1.6 (green on) ret ; Red_Off bic.b #00000001b,&P1OUT ; set P1.0 (red on) ret Wait mov.w #31834,R10 ; load R10 with value for delay L1 dec.w R10 ; decrement R10 jnz L1 ; if R10 is not zero jump to L1 ret .end ;
  12. Like
    voodoofish reacted to DanAndDusty in 25AA320A SPI eeprom read and write   
    Cool. Glad I could help.
     
    The chips are nice to work with aren't they? I especially like the HOLD line.. Means I can use the SPI pins for connecting to another device and not worry about dropping the CS (which will interrupt/cancel any pending read/write). Very useful when the other SPI device is a DAC that wants 1 byte 44K times a second
     
    Dan
  13. Like
    voodoofish reacted to DanAndDusty in 25AA320A SPI eeprom read and write   
    Hi Voodoo,
     
    Coincidence you post this as at the moment Im working on a little "halloween" project with a similar chip (25AA1024). My project has this chip, a DAC, an LDR for triggering the sound and a serial connection (for menu/control and using the Xmodem protocol to upload soundfiles to the EEPROM)..
     
    What I do is after a write I read the status register because there is a Write In Process bit. my code is...
     

    void EEPROM_writeEnd(void) { /* ********************************************************************************************* * * * * * EEPROM_writeEnd This function simply takes the CS line down low (to commit the * * * data to be written. It then waits until the WIP bit in the * * * Status Register is cleared indicating the write is complete * * * * * ********************************************************************************************* * * PARAMETERS:- None * * ********************************************************************************************* * * RETURNS:- None * * ********************************************************************************************* */ P2OUT |= EEPROM_CS; // De-asserting CS performs the write while((EEPROM_getStatus() & MSK_STAT_WIP) == MSK_STAT_WIP) // Wait until there is no write in progress {} }
     
    Just had a look at the datasheet for the 25AA320A and it works the same way. This bit is also set for the Erase instructions.. The Erase Whole Chip instruction in particular can take some time.
     
    I have the project working satisfactorily through a PC Speaker amplifier setup, but I want it working through a standard 8 Ohm 0.25W speaker. This morning some LM386 chips arrived in the post. Im hoping to set these setup/debugged this weekend. Then maybe I'll have my 1st project posted up here.
     
    Hope this helps..
     
    Dan
  14. Like
    voodoofish got a reaction from bluehash in 25AA320A SPI eeprom read and write   
    Posted my code to github for others to pull down and use.
    It's not clean(I'm still a nube), but it works. currently it just writes to 1 memory location, but can easily be modified for whatever purposes. I still also need to add more functions as I have not completed it...this will be done soon.
    Thanks to Rickta59 for his post related to the 23k256 ram chip. It helped to look at someone elses code and confirm that mine in fact should have worked...I liked his streamlined code as well...so I may integrate that into the next version.
    Also thanks to fj604, though he doesn't know it, but his code also was useful and used in part for the timer related code from his max6957 project.
     
    As a short description of the problem. I was running into issues with reading the memory after writing to location X. When stepping through, I would get the correct value, but when allowing the code to just run I would get 0 for the read data. I added a timer delay (fj604 code)after the write which gives the chip enough time to wait for the memory to be written. I could have sworn I had tried something similar and it didn't work, but this one did. The timer value will most likely need to be changed based on the the mclk and smclk....so that will be up to the person using this to figure it out.
    This was run on a G2231 chip running at the base 1mhz.
     
    https://github.com/voodoofish/MemoryWriter25AA320A
  15. Like
    voodoofish got a reaction from Rickta59 in 25AA320A SPI eeprom read and write   
    Posted my code to github for others to pull down and use.
    It's not clean(I'm still a nube), but it works. currently it just writes to 1 memory location, but can easily be modified for whatever purposes. I still also need to add more functions as I have not completed it...this will be done soon.
    Thanks to Rickta59 for his post related to the 23k256 ram chip. It helped to look at someone elses code and confirm that mine in fact should have worked...I liked his streamlined code as well...so I may integrate that into the next version.
    Also thanks to fj604, though he doesn't know it, but his code also was useful and used in part for the timer related code from his max6957 project.
     
    As a short description of the problem. I was running into issues with reading the memory after writing to location X. When stepping through, I would get the correct value, but when allowing the code to just run I would get 0 for the read data. I added a timer delay (fj604 code)after the write which gives the chip enough time to wait for the memory to be written. I could have sworn I had tried something similar and it didn't work, but this one did. The timer value will most likely need to be changed based on the the mclk and smclk....so that will be up to the person using this to figure it out.
    This was run on a G2231 chip running at the base 1mhz.
     
    https://github.com/voodoofish/MemoryWriter25AA320A
  16. Like
    voodoofish got a reaction from bluehash in Launchpad 16bit IO expander board   
    More work was done on this project. I worked on an interface board to allow me to attach a HD44780 based LCD panel to the io expander. This is of course just a test setup and worked out though with a bit of a memory issue at the moment. So here is a shot of the board with the IOexpander with the LCD interface board. Shoutout to the site. :thumbup:

    I will be working on memory related issues as this currently eats up quite a bit, but considering I brought it down from 1.7k(I went above the max limit initially) to 1k, the next update should streamline the test functions a bit more. I'm also running the lcd in 4bit mode to conserve expander pins.
  17. Like
    voodoofish got a reaction from GeekDoc in Launchpad 16bit IO expander board   
    A note on the cost and time estimates.
    Time: 8 hours time for the full project (rough estimate).
    Cost: $30 roughly
    Time = time to draw out the schematic, do the layout and then populate the board. It's also the little things that seem to be the most time consuming and also what seems to not take long until you look at the clock.
    Cost = cost of getting the boards fabbed(you get 3) plus parts to populate the board. This is the high side. actual cost of the board iteself would be around 10-15.
    MSP430 IO 16bit Expansion board(shield)
     
    This is the second shield I've created for the MSP430 launchpad dev boards. This board provides a 16bit io chip that can be set up as either an I2C or SPI, but not both as each chip only provides support for 1 protocol. I've provided a means for configuring the address of the chip if needed, the reset pin can be hardwired or or set by the proc and there are two options for the enable pin, one for 16pin and the other for 20 pin chips to use.
    I can provide the schematics and layout if desired.
    This was created in eagle cad(still new to it.)
     
    Just as a side, the first shield was a test to make sure the fitment would work. It consisted of a memory chip(MCP 25AA320A) and an rtc(maxim don't recall the model atm). Oringinally it was meant to also contain the second chip(2211) and take various sensor measurements(via CompA). If you like I can also post this as a different project...though not a very good one.
     
    About the code. Currently there is none(sort of). This design was based on work with the MCP23S18 chip which I have some code for(I can post the perfboard design I started out with). As the two chips are pretty much identical in terms of commands and registers(mostly), this should be fairly easy(I know I'm jinxing myself). The 23S18 is the openDrain version of the chip(picked this one up on accident). I'll be working on the code and post when I have something(weekend I suspect). The code only works with spi, but I'll see about getting some I2C code and the board built to test in the near future.
     
    At the time I was designing the board I wasn't aware that there was a (semi)formal design spec for shields so this may have deviated from it a bit.
     
    Thoughts, opinons, recommendations?
     
    IO chip - MCP23X17 IO expander with serial interface.
     
    supports I2C or SPI
    Configurable interupt output pins
    Configurable interupt source
    External reset
    Low standby current
    Operating voltages work well with msp430
     
    Some possible uses:
    Some uses that I was considering.
    multiple 4pin lcd controller(HD44780)
    LED display controller(no pwm though)
    Keypad input interface
    rotary encoder interface(using port A and B ints I think this can be done)
    Expanded inputs for something like comparator devices.(INT triggered)
  18. Like
    voodoofish got a reaction from zborgerd in Launchpad 16bit IO expander board   
    A note on the cost and time estimates.
    Time: 8 hours time for the full project (rough estimate).
    Cost: $30 roughly
    Time = time to draw out the schematic, do the layout and then populate the board. It's also the little things that seem to be the most time consuming and also what seems to not take long until you look at the clock.
    Cost = cost of getting the boards fabbed(you get 3) plus parts to populate the board. This is the high side. actual cost of the board iteself would be around 10-15.
    MSP430 IO 16bit Expansion board(shield)
     
    This is the second shield I've created for the MSP430 launchpad dev boards. This board provides a 16bit io chip that can be set up as either an I2C or SPI, but not both as each chip only provides support for 1 protocol. I've provided a means for configuring the address of the chip if needed, the reset pin can be hardwired or or set by the proc and there are two options for the enable pin, one for 16pin and the other for 20 pin chips to use.
    I can provide the schematics and layout if desired.
    This was created in eagle cad(still new to it.)
     
    Just as a side, the first shield was a test to make sure the fitment would work. It consisted of a memory chip(MCP 25AA320A) and an rtc(maxim don't recall the model atm). Oringinally it was meant to also contain the second chip(2211) and take various sensor measurements(via CompA). If you like I can also post this as a different project...though not a very good one.
     
    About the code. Currently there is none(sort of). This design was based on work with the MCP23S18 chip which I have some code for(I can post the perfboard design I started out with). As the two chips are pretty much identical in terms of commands and registers(mostly), this should be fairly easy(I know I'm jinxing myself). The 23S18 is the openDrain version of the chip(picked this one up on accident). I'll be working on the code and post when I have something(weekend I suspect). The code only works with spi, but I'll see about getting some I2C code and the board built to test in the near future.
     
    At the time I was designing the board I wasn't aware that there was a (semi)formal design spec for shields so this may have deviated from it a bit.
     
    Thoughts, opinons, recommendations?
     
    IO chip - MCP23X17 IO expander with serial interface.
     
    supports I2C or SPI
    Configurable interupt output pins
    Configurable interupt source
    External reset
    Low standby current
    Operating voltages work well with msp430
     
    Some possible uses:
    Some uses that I was considering.
    multiple 4pin lcd controller(HD44780)
    LED display controller(no pwm though)
    Keypad input interface
    rotary encoder interface(using port A and B ints I think this can be done)
    Expanded inputs for something like comparator devices.(INT triggered)
  19. Like
    voodoofish got a reaction from lvagasi in Launchpad 16bit IO expander board   
    A note on the cost and time estimates.
    Time: 8 hours time for the full project (rough estimate).
    Cost: $30 roughly
    Time = time to draw out the schematic, do the layout and then populate the board. It's also the little things that seem to be the most time consuming and also what seems to not take long until you look at the clock.
    Cost = cost of getting the boards fabbed(you get 3) plus parts to populate the board. This is the high side. actual cost of the board iteself would be around 10-15.
    MSP430 IO 16bit Expansion board(shield)
     
    This is the second shield I've created for the MSP430 launchpad dev boards. This board provides a 16bit io chip that can be set up as either an I2C or SPI, but not both as each chip only provides support for 1 protocol. I've provided a means for configuring the address of the chip if needed, the reset pin can be hardwired or or set by the proc and there are two options for the enable pin, one for 16pin and the other for 20 pin chips to use.
    I can provide the schematics and layout if desired.
    This was created in eagle cad(still new to it.)
     
    Just as a side, the first shield was a test to make sure the fitment would work. It consisted of a memory chip(MCP 25AA320A) and an rtc(maxim don't recall the model atm). Oringinally it was meant to also contain the second chip(2211) and take various sensor measurements(via CompA). If you like I can also post this as a different project...though not a very good one.
     
    About the code. Currently there is none(sort of). This design was based on work with the MCP23S18 chip which I have some code for(I can post the perfboard design I started out with). As the two chips are pretty much identical in terms of commands and registers(mostly), this should be fairly easy(I know I'm jinxing myself). The 23S18 is the openDrain version of the chip(picked this one up on accident). I'll be working on the code and post when I have something(weekend I suspect). The code only works with spi, but I'll see about getting some I2C code and the board built to test in the near future.
     
    At the time I was designing the board I wasn't aware that there was a (semi)formal design spec for shields so this may have deviated from it a bit.
     
    Thoughts, opinons, recommendations?
     
    IO chip - MCP23X17 IO expander with serial interface.
     
    supports I2C or SPI
    Configurable interupt output pins
    Configurable interupt source
    External reset
    Low standby current
    Operating voltages work well with msp430
     
    Some possible uses:
    Some uses that I was considering.
    multiple 4pin lcd controller(HD44780)
    LED display controller(no pwm though)
    Keypad input interface
    rotary encoder interface(using port A and B ints I think this can be done)
    Expanded inputs for something like comparator devices.(INT triggered)
  20. Like
    voodoofish got a reaction from xpg in Launchpad 16bit IO expander board   
    A note on the cost and time estimates.
    Time: 8 hours time for the full project (rough estimate).
    Cost: $30 roughly
    Time = time to draw out the schematic, do the layout and then populate the board. It's also the little things that seem to be the most time consuming and also what seems to not take long until you look at the clock.
    Cost = cost of getting the boards fabbed(you get 3) plus parts to populate the board. This is the high side. actual cost of the board iteself would be around 10-15.
    MSP430 IO 16bit Expansion board(shield)
     
    This is the second shield I've created for the MSP430 launchpad dev boards. This board provides a 16bit io chip that can be set up as either an I2C or SPI, but not both as each chip only provides support for 1 protocol. I've provided a means for configuring the address of the chip if needed, the reset pin can be hardwired or or set by the proc and there are two options for the enable pin, one for 16pin and the other for 20 pin chips to use.
    I can provide the schematics and layout if desired.
    This was created in eagle cad(still new to it.)
     
    Just as a side, the first shield was a test to make sure the fitment would work. It consisted of a memory chip(MCP 25AA320A) and an rtc(maxim don't recall the model atm). Oringinally it was meant to also contain the second chip(2211) and take various sensor measurements(via CompA). If you like I can also post this as a different project...though not a very good one.
     
    About the code. Currently there is none(sort of). This design was based on work with the MCP23S18 chip which I have some code for(I can post the perfboard design I started out with). As the two chips are pretty much identical in terms of commands and registers(mostly), this should be fairly easy(I know I'm jinxing myself). The 23S18 is the openDrain version of the chip(picked this one up on accident). I'll be working on the code and post when I have something(weekend I suspect). The code only works with spi, but I'll see about getting some I2C code and the board built to test in the near future.
     
    At the time I was designing the board I wasn't aware that there was a (semi)formal design spec for shields so this may have deviated from it a bit.
     
    Thoughts, opinons, recommendations?
     
    IO chip - MCP23X17 IO expander with serial interface.
     
    supports I2C or SPI
    Configurable interupt output pins
    Configurable interupt source
    External reset
    Low standby current
    Operating voltages work well with msp430
     
    Some possible uses:
    Some uses that I was considering.
    multiple 4pin lcd controller(HD44780)
    LED display controller(no pwm though)
    Keypad input interface
    rotary encoder interface(using port A and B ints I think this can be done)
    Expanded inputs for something like comparator devices.(INT triggered)
  21. Like
    voodoofish got a reaction from RobG in Launchpad 16bit IO expander board   
    A note on the cost and time estimates.
    Time: 8 hours time for the full project (rough estimate).
    Cost: $30 roughly
    Time = time to draw out the schematic, do the layout and then populate the board. It's also the little things that seem to be the most time consuming and also what seems to not take long until you look at the clock.
    Cost = cost of getting the boards fabbed(you get 3) plus parts to populate the board. This is the high side. actual cost of the board iteself would be around 10-15.
    MSP430 IO 16bit Expansion board(shield)
     
    This is the second shield I've created for the MSP430 launchpad dev boards. This board provides a 16bit io chip that can be set up as either an I2C or SPI, but not both as each chip only provides support for 1 protocol. I've provided a means for configuring the address of the chip if needed, the reset pin can be hardwired or or set by the proc and there are two options for the enable pin, one for 16pin and the other for 20 pin chips to use.
    I can provide the schematics and layout if desired.
    This was created in eagle cad(still new to it.)
     
    Just as a side, the first shield was a test to make sure the fitment would work. It consisted of a memory chip(MCP 25AA320A) and an rtc(maxim don't recall the model atm). Oringinally it was meant to also contain the second chip(2211) and take various sensor measurements(via CompA). If you like I can also post this as a different project...though not a very good one.
     
    About the code. Currently there is none(sort of). This design was based on work with the MCP23S18 chip which I have some code for(I can post the perfboard design I started out with). As the two chips are pretty much identical in terms of commands and registers(mostly), this should be fairly easy(I know I'm jinxing myself). The 23S18 is the openDrain version of the chip(picked this one up on accident). I'll be working on the code and post when I have something(weekend I suspect). The code only works with spi, but I'll see about getting some I2C code and the board built to test in the near future.
     
    At the time I was designing the board I wasn't aware that there was a (semi)formal design spec for shields so this may have deviated from it a bit.
     
    Thoughts, opinons, recommendations?
     
    IO chip - MCP23X17 IO expander with serial interface.
     
    supports I2C or SPI
    Configurable interupt output pins
    Configurable interupt source
    External reset
    Low standby current
    Operating voltages work well with msp430
     
    Some possible uses:
    Some uses that I was considering.
    multiple 4pin lcd controller(HD44780)
    LED display controller(no pwm though)
    Keypad input interface
    rotary encoder interface(using port A and B ints I think this can be done)
    Expanded inputs for something like comparator devices.(INT triggered)
×
×
  • Create New...