Discussion forum for the BasicX family of microcontroller chips.
|
>I2C communication, I was wondering if that is possible with the BX24? Sure. That is the first thing I did with mine. I takes only two I/O pins. I got my help from info posted to this group and on Professor Anderson's site: http://www.phanderson.com/basicx/index.html I have used I2C for temperature sensors, additional 8 bit ports, D/A convertors, and added ROM. They all work well for me. Here is some of my stuff: http://zeus.ia.net/~kwradio/BasicX/ Good luck with your BX-24. John Ely, W0GN |
|
|
|
I need accurate feedback about the state of the 8 relays. Can anybody suggest a circuit using the 8 digital input pins to mirror the actual state of the relays? --- http://www.laser.com/dhouston/ |
|
|
|
Solder up some header pins to the ADC inputs. Set the ADCs to the 0 - 10 volts setting with a jumper. This is for safety reasons only. You can use the 0 - 5 volt default settings (no jumpers), but better safe then sorry. Then wire the relay outputs to the ADC inputs. One to each ADC. When you want to know the relay setting, read the ADC that the relay is wired to. If a relay is set, you will get ADC conversion readings with values greater then zero. A small resister wouldn't hurt either between the Relay and the ADC. I've used it without one...but I did have the voltage jumper at 0-10 and the relay only puts out about 5 volts. There no fancy circuit involved...its a straight wire thru. You can also just track the relays logically with a Byte variable. I use one called bxRelays. Set the byte to bx00000000 at startup and send it to the LCD+ as part of your initialization process. That will set all relays to off and now you know the state of all the relays. Then only use that byte in logic to set them on....like: bxRelays = bx11110000 ;Relays 5 thru 7 on.... The byte value will always reflect the state of the relays come time to examine the state of the relays. This way is easier then the ADC wired way. I wanted my ADCs for battery measurement and other things so I use the Logical Method all the time now. You can also use a persistent variable and store the state of the relays between BX resets. .db. -----Original Message----- From: Dave Houston [mailto:] Sent: Saturday, December 08, 2001 2:53 PM To: Subject: [BasicX] LCD+ question I need accurate feedback about the state of the 8 relays. Can anybody suggest a circuit using the 8 digital input pins to mirror the actual state of the relays? --- http://www.laser.com/dhouston/ Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed] |
|
|
|
Dedicating all 8 analog inputs to track the relays may be unacceptable as Dan suggests below. The "keypad" inputs can be set to byte-wide input by sending a CTRL-Y to the LCD+ . Reading the 0-255 value returned would seem to be the "digital" inputs that Dave was asking about. What is "accurate"/certain depends in part what you think the most important failures modes of your system are. There are at least seven ways/circuit points to obtain feedback on relay status: 1) logic status of software as Dan suggests below, 2) at the input to the ULN2803A relay drivers, 3) at the output of relay drivers as Dan suggests below 4) magnetic coupling to relay coils, 5) monitoring the second pole in a Double Pole relay in which one pole is used to switch and the second pole to monitor 6) direct reading of relay output/signal -- would require conditioning/conversion if audio, 115VAC etc), 7) independent observation of effect caused by relay action (light sensor to note that light is switched on/off etc). So: #2 The simplest electrical approach , but still very useful IME, is to #2) -- jumper from the "keypad" inputs to the relay driver inputs. These points are readily accessible on the LCD+ and are at safe voltage levels (5VDC) so no protection circuitry is needed. But this approach doesn't monitor for bad relay drivers as does #3) #3 Using the relay driver output with the digital keypad input may require a bit of experimentation. The ULN2803A relay driver has open collector output stages so "high" = VCC voltage = "relay off" (not "on" as Dan writes). And depending on the relay coil current, "on" may be as much as 1.5 volts, and will never be zero (as Dan implies below). So using the ULN2803A output will require conditioning with resistors, zeners, and(or) octal buffer. Note that if the relay supply is derived from a different source than the LCD+ power, monitoring the ULN2803A inputs as in #2 may be actually preferable to monitoring the outputs as in #3 . Measuring the relay driver output will result in a relay power supply failure being misinterpreted as the relay being stuck *on* -- not "off" as it actually is! What is "accurate"/certain depends in part what you think the most important failures modes will be. #5 A more certain approach is #5, using one pole of a Double Pole relay to monitor relay position. With a DPDT, the normally closed terminal can be wired to ground and the normally open terminal to 5VDC with the signal to the "keypad" from the middle terminal. This provides a positive logic signal to the "keypad" input. With DPST, wire 5VDC to one terminal and a pull down resistor to ground at the other terminal to which the "keypad" digital input is also connected. This monitors for most failure modes including bad wiring to the relay, missing/burnt out relays, and bad relay power supply. But the LCD+ could be destroyed if mis-wired so protection with an octal buffer and(or) resistance dividers+zeners may be needed if depending on the likelihood of mis-wiring. If one uses (e.g.) DIP relays on PC board, and only one pole is brought out to a connector for the user to muck with, no protection circuitry is needed IMO. 5VDC DPDT and DPST relays are readily available. Preferably use a 6VDC (not 5VDC) regulator to account for the two diode drops (~1.2V) across the relay driver output stage and to minimize spikes on the LCD+ supply. HTH ... Marc Marc F. Hult > -----Original Message----- > From: Dan Bielecki [mailto:] > Sent: Saturday, December 08, 2001 9:30 PM > To: > Subject: RE: [BasicX] LCD+ question > Solder up some header pins to the ADC inputs. > Set the ADCs to the 0 - 10 volts setting with a jumper. > This is for safety reasons only. > You can use the 0 - 5 volt default settings (no jumpers), but better safe > then sorry. > > Then wire the relay outputs to the ADC inputs. One to each ADC. > When you want to know the relay setting, read the ADC that the relay is > wired to. > If a relay is set, you will get ADC conversion readings with > values greater > then zero. > > A small resister wouldn't hurt either between the Relay and the ADC. > I've used it without one...but I did have the voltage jumper at > 0-10 and the > relay only puts out about 5 volts. > There no fancy circuit involved...its a straight wire thru. > > You can also just track the relays logically with a Byte variable. I use > one called bxRelays. > Set the byte to bx00000000 at startup and send it to the LCD+ as part of > your initialization process. > That will set all relays to off and now you know the state of all the > relays. > Then only use that byte in logic to set them on....like: > > bxRelays = bx11110000 ;Relays 5 thru 7 on.... > > The byte value will always reflect the state of the relays come time to > examine the state of the relays. > This way is easier then the ADC wired way. I wanted my ADCs for battery > measurement and other things > so I use the Logical Method all the time now. > > You can also use a persistent variable and store the state of the relays > between BX resets. > > .db. > > > -----Original Message----- > From: Dave Houston [mailto:] > Sent: Saturday, December 08, 2001 2:53 PM > To: > Subject: [BasicX] LCD+ question > I need accurate feedback about the state of the 8 relays. Can anybody > suggest a circuit using the 8 digital input pins to mirror the actual > state of the relays? > --- > http://www.laser.com/dhouston/ |
|
|
|
Hummm...I've never used the CTRL-Y feature on my LCD+. I have a keypad attached. Guess I'll have to mess with it one day. The original post wasn't actually clear as to which digital inputs of the LCD were desired. The keypad or or Analog-to-Digital converters. I just figured the ADCs. (50/50 coin toss....) As for my non-zeros remark.........When I first receive my LCD+ I was messing around with the relays and the ADCs.....I was testing for values greater the 3.0 personally. The relays I was using at the time were triggered at 3 volts. So I used three as my low end test value. I never checked with my volt meter what the true low-end value was. I knew that anything greater then 3.0 volts were "relays readings". My logic at the time didn't even care what the true value was...just IF ADCvalue > 3.0 Then...Blaa blaa.....Else..... Blaa blaa.... I knew ahead of time the relays were triggered at three volts. My non-zero comment was more of a generalized statement. Sorry if it misled. Now you got me so curious...I'm gonna check that true low end value with my meter...next time my unit is opened. And even maybe rewire that keypad connector with an unplugable pad so I can play around with CTRL-Y and read that port...... That could come in handy.... .db. -----Original Message----- From: Marc F. Hult [mailto:] Sent: Sunday, December 09, 2001 11:54 AM To: Subject: RE: [BasicX] LCD+ question Dedicating all 8 analog inputs to track the relays may be unacceptable as Dan suggests below. The "keypad" inputs can be set to byte-wide input by sending a CTRL-Y to the LCD+ . Reading the 0-255 value returned would seem to be the "digital" inputs that Dave was asking about. What is "accurate"/certain depends in part what you think the most important failures modes of your system are. There are at least seven ways/circuit points to obtain feedback on relay status: 1) logic status of software as Dan suggests below, 2) at the input to the ULN2803A relay drivers, 3) at the output of relay drivers as Dan suggests below 4) magnetic coupling to relay coils, 5) monitoring the second pole in a Double Pole relay in which one pole is used to switch and the second pole to monitor 6) direct reading of relay output/signal -- would require conditioning/conversion if audio, 115VAC etc), 7) independent observation of effect caused by relay action (light sensor to note that light is switched on/off etc). So: #2 The simplest electrical approach , but still very useful IME, is to #2) -- jumper from the "keypad" inputs to the relay driver inputs. These points are readily accessible on the LCD+ and are at safe voltage levels (5VDC) so no protection circuitry is needed. But this approach doesn't monitor for bad relay drivers as does #3) #3 Using the relay driver output with the digital keypad input may require a bit of experimentation. The ULN2803A relay driver has open collector output stages so "high" = VCC voltage = "relay off" (not "on" as Dan writes). And depending on the relay coil current, "on" may be as much as 1.5 volts, and will never be zero (as Dan implies below). So using the ULN2803A output will require conditioning with resistors, zeners, and(or) octal buffer. Note that if the relay supply is derived from a different source than the LCD+ power, monitoring the ULN2803A inputs as in #2 may be actually preferable to monitoring the outputs as in #3 . Measuring the relay driver output will result in a relay power supply failure being misinterpreted as the relay being stuck *on* -- not "off" as it actually is! What is "accurate"/certain depends in part what you think the most important failures modes will be. #5 A more certain approach is #5, using one pole of a Double Pole relay to monitor relay position. With a DPDT, the normally closed terminal can be wired to ground and the normally open terminal to 5VDC with the signal to the "keypad" from the middle terminal. This provides a positive logic signal to the "keypad" input. With DPST, wire 5VDC to one terminal and a pull down resistor to ground at the other terminal to which the "keypad" digital input is also connected. This monitors for most failure modes including bad wiring to the relay, missing/burnt out relays, and bad relay power supply. But the LCD+ could be destroyed if mis-wired so protection with an octal buffer and(or) resistance dividers+zeners may be needed if depending on the likelihood of mis-wiring. If one uses (e.g.) DIP relays on PC board, and only one pole is brought out to a connector for the user to muck with, no protection circuitry is needed IMO. 5VDC DPDT and DPST relays are readily available. Preferably use a 6VDC (not 5VDC) regulator to account for the two diode drops (~1.2V) across the relay driver output stage and to minimize spikes on the LCD+ supply. HTH ... Marc Marc F. Hult > -----Original Message----- > From: Dan Bielecki [mailto:] > Sent: Saturday, December 08, 2001 9:30 PM > To: > Subject: RE: [BasicX] LCD+ question > Solder up some header pins to the ADC inputs. > Set the ADCs to the 0 - 10 volts setting with a jumper. > This is for safety reasons only. > You can use the 0 - 5 volt default settings (no jumpers), but better safe > then sorry. > > Then wire the relay outputs to the ADC inputs. One to each ADC. > When you want to know the relay setting, read the ADC that the relay is > wired to. > If a relay is set, you will get ADC conversion readings with > values greater > then zero. > > A small resister wouldn't hurt either between the Relay and the ADC. > I've used it without one...but I did have the voltage jumper at > 0-10 and the > relay only puts out about 5 volts. > There no fancy circuit involved...its a straight wire thru. > > You can also just track the relays logically with a Byte variable. I use > one called bxRelays. > Set the byte to bx00000000 at startup and send it to the LCD+ as part of > your initialization process. > That will set all relays to off and now you know the state of all the > relays. > Then only use that byte in logic to set them on....like: > > bxRelays = bx11110000 ;Relays 5 thru 7 on.... > > The byte value will always reflect the state of the relays come time to > examine the state of the relays. > This way is easier then the ADC wired way. I wanted my ADCs for battery > measurement and other things > so I use the Logical Method all the time now. > > You can also use a persistent variable and store the state of the relays > between BX resets. > > .db. > > > -----Original Message----- > From: Dave Houston [mailto:] > Sent: Saturday, December 08, 2001 2:53 PM > To: > Subject: [BasicX] LCD+ question > I need accurate feedback about the state of the 8 relays. Can anybody > suggest a circuit using the 8 digital input pins to mirror the actual > state of the relays? > --- > http://www.laser.com/dhouston/ Yahoo! Groups Sponsor ADVERTISEMENT Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. [Non-text portions of this message have been removed] |