You lost me. Are these BCD outputs any different to the BCD thumbwheel switch outputs (apart from the selectable active level)? So is this correct: "On the other end I need 2 BCD outputs which may be configured to be active high or active low."On the other end I need 2 BCD outputs to select the eprom outputs selectable to be active high or active low.
Please explain.My next requirement if possible would be to have each of the BCD outputs drive a 7 segment display and be independant of the active state of the BCD outputs.
I can'tI can visualise what needs to happen
BCD 99 would be 1001.1001.0110.0011 (chan 99)
Sorry, not without an extra IC or some horrible passives (RC)C'mon guys. Any ideas on how to fit that all on an 18-pin PIC?
That'll work; you just need enough pins or an expander (or decoder e.g. 7447)Perhaps connecting the two switch inputs onto a couple segment driver lines and reading or polling them periodically?
That will save you having to use extra chips.I would not mind going to a 28 pin device
That won't work if you still require the active high/low sense of the BCD output.the BCD output to drive a couple of Texas TIL308
Not if the wiring changes (will require a rewrite). Otherwise it's possible.Another question, would the routine for doing the rotary switch input in the 28 pin Pic be transferable to say 16F84
Yeah, there are people that put routines for certain purposes on the net. In all different languages and programming styles, I prefer just to write my own. A quick google should help you here.Are there any cookbook type sites that have routines for things like I am trying to do, sort of like modules for different purposes?.
;
; ISR "display driver" code (8-msec intervals = 62.5 Hz refresh rate)
;
refresh
movf PORTB,W ; WREG = PORTB |B0
andlw 0x80 ; clear the b6..b0 segment bits |B0
xorlw 0x80 ; toggle b7 digit select bit |B0
movwf PORTB ; blank display, select new digit |B0
swapf channel,W ; W = 'tens' in right nybble |B0
btfss PORTB,7 ; tens display? yes, skip, else |B0
movf channel,W ; W = 'ones' in right nybble |B0
call segtbl ; get digit segment data |B0
iorwf PORTB,F ; display new digit |B0
;
; segment data table (caveat, non-boundary tolerant)
;
segtbl
andlw 0x0F ; strip off upper nybble |B0
addwf PCL,F ; |B0
retlw b'00111111' ; "0" -|-|F|E|D|C|B|A |B0
retlw b'00000110' ; "1" -|-|-|-|-|C|B|- |B0
retlw b'01011011' ; "2" -|G|-|E|D|-|B|A |B0
retlw b'01001111' ; "3" -|G|-|-|D|C|B|A |B0
retlw b'01100110' ; "4" -|G|F|-|-|C|B|- |B0
retlw b'01101101' ; "5" -|G|F|-|D|C|-|A |B0
retlw b'01111101' ; "6" -|G|F|E|D|C|-|A |B0
retlw b'00000111' ; "7" -|-|-|-|-|C|B|A |B0
retlw b'01111111' ; "8" -|G|F|E|D|C|B|A |B0
retlw b'01101111' ; "9" -|G|F|-|D|C|B|A |B0
;
; increment "channel" if channel < upper_limit (99)
;
ChanInc
movf channel,W ; |B0
addlw 7 ; increment + bcd adjust? |B0
skpdc ; yes, skip, else |B0
addlw -6 ; increment only |B0
movwf channel ; update 'channel' var |B0
return ; |B0
;
; decrement "channel" if channel > 1
;
ChanDec
movf channel,W ; |B0
addlw -1 ; decrement only? |B0
skpdc ; yes, skip, else |B0
addlw -6 ; decrement + bcd adjust |B0
movwf channel ; update 'number' var |B0
return ; |B0
You can use assembler, C, C++, BASIC etc. - you just need to get a compiler. There are a number of freebies and free trials. Microchip, hitech, boost-c/c++/basic (sourceboost: Index of /Products), crownhill and others supply limited compilers for free. They will be sufficient for your purpose.I presume whatever I do will have to be in Assembler, suggestion?
-I is industrial temperature range. /SP is the package type (SPDIP)16F886-I/SP's if it will work (28 pin dips). What does the -I and the -S mean I can't find any reference to it.
One of the afforementioned compilers or an assembler. Or ask nicely and a .hex might just turn up.What do I have to aquire to produce a hex file for the programmer?
It's just plain old binary. BCD is where each nibble (4 bits) is used to represent a digit 0-9, so 8 bits of BCD can go from 0-99. 8 bits of what was called 'packed' (above) binary has a range of 0-255.and what is packed BCD.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?