They are ready to use now, nearly two years after the PCBs were made.
XC8 is used now both for the displays, and to send the serial data.
Since a 16f54 is used, each time the data is sent, the display goes off for 20 msecs. This is because of the DRT (Device reset timer).
A 16f716 could be used which is pin compatible.
The code to send the serial data is shown.
It is also possible to use the hardware serial port!
However, 20 milliseconds delay is neccessary each time as long as 16f54 is used.
Having the displays available now means a simplification for many circuits. Never to wire 7seg. displays again!
I made it working using assembler, but it was so complicated, I did not want to use them myself. As well, external components were neccessary. Not anymore! Only 3 wires are required.
Note the display PCB is on the bottom of the LED 7seg module. The green PCB is only used for testing (16f1503).
The switches are neccessary for FLASH programming since the header is shared, as well the pins are used to transmit the serial data. Later in a real circuit, no switches are needed.
The displays will be available soon for sale. Time to make a profit of $1 or $2 after years and spending 1000s on components.
XC8 is used now both for the displays, and to send the serial data.
Since a 16f54 is used, each time the data is sent, the display goes off for 20 msecs. This is because of the DRT (Device reset timer).
A 16f716 could be used which is pin compatible.
The code to send the serial data is shown.
It is also possible to use the hardware serial port!
However, 20 milliseconds delay is neccessary each time as long as 16f54 is used.
Having the displays available now means a simplification for many circuits. Never to wire 7seg. displays again!
I made it working using assembler, but it was so complicated, I did not want to use them myself. As well, external components were neccessary. Not anymore! Only 3 wires are required.
Rich (BB code):
#include <xc.h> /* XC8 General Include File */
#include "system.h" /* System funct/params, like osc/peripheral config */
#include "user.h" /* User funct/params, such as InitApp */
#define clk LATAbits.LATA0
#define dat LATAbits.LATA1
#define reset LATCbits.LATC1
#define delay 0
unsigned int tmr0;
void send_ser(unsigned char ser_dat)
{unsigned char i;
if(ser_dat&0x01)dat=1; else dat=0;
clk=1;i=delay;while(i--);clk=0;
if(ser_dat&0x02)dat=1; else dat=0;
clk=1;i=delay;while(i--);clk=0;
if(ser_dat&0x04)dat=1; else dat=0;
clk=1;i=delay;while(i--);clk=0;
if(ser_dat&0x08)dat=1; else dat=0;
clk=1;i=delay;while(i--);clk=0;
if(ser_dat&0x10)dat=1; else dat=0;
clk=1;i=delay;while(i--);clk=0;
}
void init_ser()
{unsigned int i;
clk=0;
dat=0;
reset=0;
reset=1;
i=200;while(i--);
}
void interrupt isr(void)
{
if(TMR0IF)
{
TMR0IF=0; /* Clear Interrupt Flag 1 */
tmr0++;
if(tmr0>20)
{
LATC=0;
LATA=0;
TRISA=0b11111100;
TRISC=0b11110101;
tmr0=0;
init_ser();
send_ser(1);
send_ser(2);
send_ser(3);
send_ser(4);
TRISA=0xff;
TRISC=0b11110111;
}}
}
void main(void)
{
InitApp();
GIE=1;
TMR0IE=1;
while(1){}
}
The switches are neccessary for FLASH programming since the header is shared, as well the pins are used to transmit the serial data. Later in a real circuit, no switches are needed.
The displays will be available soon for sale. Time to make a profit of $1 or $2 after years and spending 1000s on components.
Attachments
-
256.6 KB Views: 30
-
169.9 KB Views: 21