motion said:However, there are also technical problems to surmount to use the PIC16F54. Besides the smaller program space of 512 instruction words, the ff. are some more differences.
1. The PIC16F54 is not object code compatible with the PIC16F84. The '54 has a 12-bit instruction width while the '84 is 14-bits wide.
2. There is no RA4 on the 16F54. Getting the bit state of the serial data is tricky at best.
3. There are no interrupts on the 16F54. You might have to poll the port at high scan rate to accurately detect leading edge of the start bit. This could limit the highest baud rate you can receive data.
4. The call stack is only two levels deep.
I don't see any relevence to RA4?, RA4 is simply an open-collector output, if you don't require that (and not much does), it won't cause any problems.
motion said:I don't see any relevence to RA4?, RA4 is simply an open-collector output, if you don't require that (and not much does), it won't cause any problems.
Oh yeah? The serial data line is connected to pin3 of the chip. It is supposed to be connected to bit4. On the '84 in the i/o expander, it is configured as input not output. Bit4 of portA in the 16F54 will always read as '0'.
Big deal! - stick it on a different pin! - that's the least of the problems!.
GatorGuy said:For the most part the only reason for the swap is price. I will stay away from the 16F54 if there is that much of a difference. The $2 or so won’t break the bank. Thank you for all of the input. As far as the programming language I am going to be using VB6 using MSCOM. As far as this schematic I only have one use for this circuit. I only need to be able to send commands to it turning relays on and off. I wont have any need to store any programs on the chip.
GatorGuy said:I am still researching using the MSCOMM function but I believe you can send the pin number and pin state to change the pin from high to low or low to high. Correct me if I am wrong. I am pretty new with the PIC's as you can tell. Again thank you for all of the help. And no I do not have a programmer as of yet but that will before building it. I also have examples of the BASIC code to program the PIC.
MSComm1.Output = Chr$(255) & Chr$(PinNumber) & Chr$(PinState)
GatorGuy said:I am still researching using the MSCOMM function but I believe you can send the pin number and pin state to change the pin from high to low or low to high. Correct me if I am wrong.
Nigel Goodwin said:GatorGuy said:I am still researching using the MSCOMM function but I believe you can send the pin number and pin state to change the pin from high to low or low to high. Correct me if I am wrong. I am pretty new with the PIC's as you can tell. Again thank you for all of the help. And no I do not have a programmer as of yet but that will before building it. I also have examples of the BASIC code to program the PIC.
MSComm1.Output = Chr$(255) & Chr$(PinNumber) & Chr$(PinState)
That doesn't look right?, I'm presuming '&' is a logical AND?, you need '+' to send the three bytes of data. I can't comment on the use of MSCOMM itself as I've never used it (nor VB).
Examples of the BASIC code for the PIC won't help unless you have a copy of PIC BASIC - which is a (fairly expensive) commercial program.
Dim qualifier as variant
Dim pinnumber as variant
Dim pinstate as variant
' change the datatypes as necessary
' and convert to ASCII if needed
MSComm.Output = chr$(qualifier)
MSComm.Output = chr$(pinnumber)
MSComm.Output = chr$(pinstate)
MSComm.Output = chr$(qualifier) & chr$(pinnumber) & chr$(pinstate)
upand_at_them said:In VB the ampersand serves to concatenate strings.
Nigel Goodwin said:upand_at_them said:In VB the ampersand serves to concatenate strings.
I said I didn't use VB 8)
upand_at_them said:Nigel, I wasn't picking on you. I was just stating it so people could understand the code he posted.
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?