Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

de-dp14211 - Sure-electronics-demoboard startup code available.....

Status
Not open for further replies.

polo-g40

Full Member level 2
Full Member level 2
Joined
Jan 12, 2011
Messages
143
Helped
36
Reputation
84
Reaction score
42
Trophy points
28
Location
Gone
Activity points
0
de-dp14211 - Sure-electronics-demoboard sample code available (upon request... ) Rebuked
Nothing amazing yet, 1st project will be a two-chanel audio-osciloscope... I've worked out the HTC chip addressing and memory arrangements for the separate colours. There are 4 "chips" per panel, and each chip has Red 0-15bytes, and Green 16-31.

I have written a nice driverboard setup for my 4xsingle color 8x32 panels to take characters from USB serial (and a few 'esc'- controls like esc-c (VT52 ClearScreen) and esc-L(n) to set the line number and esc-F(n) to set the fontsize. (I've had displaying Access database data) Hopefully this project will be an easy conversion to multi-color because there is only need to remember the 'char' of the characters to be displayed, rendering them as graphics from a const char[] font definition only when the text changes.. We really are too low on processor resources for any of the frame-buffering (ram space hungry) and graphical effects code, too much for the little 16f723. Each 16x32 panel has 4x32bytes to look after to store that in ram..

Sample code as ever...
NEAL
 
Last edited:

I don't understand the point of your post, you say you have some code to share but then you say "upon request", what does this mean , are you going to share it in private with anyone who ask for it?
This in not the purpose of this forum, if you want to share your code we will be happy to have it posted here.

Alex
 

I have just got a bad-boy audio osciloscope effect out of it though, but I doubt that'd be of interest..

Appologies
NEAL

---------- Post added at 14:45 ---------- Previous post was at 13:57 ----------

#define A_73164 RB1
#define CLK_74164 RB2

#define CLK RC3
#define DAT RC5


#include<htc.h> //include MCU head file
__CONFIG(FOSC_INTOSCIO & WDTE_OFF & nPWRTE_ON & MCLRE_ON & CP_OFF & BOREN_OFF & BORV_25 & PLLEN_ON & DEBUG_ON);
__CONFIG(VCAPEN_DIS);

#include "Delay.h"

#include "always.h"
#include "DeclareBiColor.h"

#define CHIP_MAX 4

void SystemInit();
void SetHT1632C_As3208(); //Setup CMD's for 32x08
void OutputCLK_Pulse(); //DataCLOCK
void OutputA_74164(unsigned char x); //CSPul
static void ChipSelect(int select);
static void CommandWriteHT1632C(unsigned int command);
static void AddressWriteHT1632C(unsigned char address);
static void AddToPanelData(unsigned char dotVal);
static void AddToRedPanelData(unsigned char dotVal);

static unsigned char PanelData[64] ;
static unsigned char RedPanelData[64] ;
static char c;
static unsigned char AToD;
void SPI_Model_Configure();
void SPI_DataSend(const unsigned char data);
#define SW1 RC0
#define SW2 RC1
unsigned char OscVal=0x0f;
void main()
{

APFCON=0;
CCP1CON=0; CCP2CON=0;
// OSCCON=0x7f;
ANSELB=0;
// i2 = 1;
ADON=1;
TRISA=255;
TRISB=0;
FVREN=1; // Internal a2d voltage ref
ADFVR1=0;ADFVR0=1; //1.02v V+ for adc....
ADCON0=0x8E; //AN4
ADCON1 = 0b10100011; //

ADON=1;
ANSA0 = 0;
ANSA1 = 0;
ANSA2 = 0;
ANSA3 = 0;
ANSA4 = 0;
ANSA5 = 0; //ÿһλÉèÖÃAD¿Ú¿ª¹Ø

TRISC0=1;

unsigned int i,j;
SystemInit();
SetHT1632C_As3208();
char i1=0xAA;
unsigned char Bounce=1;
signed char BounceDir=1;
char i2=0xCC;
unsigned char DotStart=0;
OSCCON=0xFE;
while(1)
{
TRISC1=1;
TRISC0=1;
if(!SW1 )
{
while(!SW1) { ; }
OscVal= OscVal+0x10;
if(OscVal>0x3f) OscVal=0x0f;
OSCCON=OscVal;
}

Bounce ++; //+= BounceDir;
Bounce %= 16;
//if(Bounce>6) BounceDir=-1;
//if(Bounce<1) BounceDir=1;
DotStart =Bounce;
AToD = 0;

GO_DONE=1; while(GO_DONE);
AToD = ADRES /2;
GO_DONE=1; while(GO_DONE);
AToD += ADRES /2;

AToD = AToD /2;
GO_DONE=1; while(GO_DONE);
AToD += ADRES /2;
AToD = AToD /2;
GO_DONE=1; while(GO_DONE);
AToD += ADRES /2;

AToD = AToD /2;
GO_DONE=1; while(GO_DONE);
AToD += ADRES /2;

AToD=AToD>>4;
AddToPanelData(AToD);
if(AToD>7) AddToRedPanelData(((AToD) -1)&15);
if(AToD<7) AddToRedPanelData(((AToD) +1)&15);
//DelayBigMs(350);


ChipSelect(1);
AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION
for(j=0;j<16;j++)
{
if(PanelData[j]>=8) SPI_DataSend(0x80>>(15-PanelData[j])); else SPI_DataSend(0);
}
for(j=0;j<16;j++)
{ if(RedPanelData[j]>=8) SPI_DataSend(0x80>>(15-RedPanelData[j])); else SPI_DataSend(0);
}

ChipSelect(3);
AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION ///
for(j=0;j<16;j++)
{
if(PanelData[j]<8) SPI_DataSend(1<<(PanelData[j])); else SPI_DataSend(0);
}
// RED PORTION
for(j=0;j<16;j++)
{ if(RedPanelData[j]<8) SPI_DataSend(1<<(RedPanelData[j])); else SPI_DataSend(0); }




ChipSelect(2);

AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION
for(j=0;j<16;j++)
{
if(PanelData[j+16]>=8) SPI_DataSend(0x80>>(15-PanelData[j+16])); else SPI_DataSend(0);
}
// RED PORTION
for(j=0;j<16;j++)
{ if(RedPanelData[j+16]>=8) SPI_DataSend(0x80>>(15-RedPanelData[j+16])); else SPI_DataSend(0);
}

ChipSelect(4);
AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION ///
for(j=0;j<16;j++)
{
if(PanelData[j+16]<8) SPI_DataSend(1<<(PanelData[j+16])); else SPI_DataSend(0);
}
for(j=0;j<16;j++)
{ if(RedPanelData[j+16]<8) SPI_DataSend(1<<(RedPanelData[j+16])); else SPI_DataSend(0); }


///////////////////////////////////
//////////




ChipSelect(5);
AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION
for(j=0;j<16;j++)
{
if(PanelData[j+32]>=8) SPI_DataSend(0x80>>(15-PanelData[j+32])); else SPI_DataSend(0);
}
for(j=0;j<16;j++)
{ if(RedPanelData[j+32]>=8) SPI_DataSend(0x80>>(15-RedPanelData[j+32])); else SPI_DataSend(0);
}

ChipSelect(7);
AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION ///
for(j=0;j<16;j++)
{
if(PanelData[j+32]<8) SPI_DataSend(1<<(PanelData[j+32])); else SPI_DataSend(0);
}
// RED PORTION
for(j=0;j<16;j++)
{ if(RedPanelData[j+32]<8) SPI_DataSend(1<<(RedPanelData[j+32])); else SPI_DataSend(0); }




ChipSelect(6);

AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION
for(j=0;j<16;j++)
{
if(PanelData[j+48]>=8) SPI_DataSend(0x80>>(15-PanelData[j+48])); else SPI_DataSend(0);
}
// RED PORTION
for(j=0;j<16;j++)
{ if(RedPanelData[j+48]>=8) SPI_DataSend(0x80>>(15-RedPanelData[j+48])); else SPI_DataSend(0);
}

ChipSelect(8);
AddressWriteHT1632C(0);
SPI_Model_Configure();
// GREEN PORTION ///
for(j=0;j<16;j++)
{
if(PanelData[j+48]<8) SPI_DataSend(1<<(PanelData[j+48])); else SPI_DataSend(0);
}
for(j=0;j<16;j++)
{ if(RedPanelData[j+48]<8) SPI_DataSend(1<<(RedPanelData[j+48])); else SPI_DataSend(0); }








/////////////////////
/////////////////////



}
}
void SystemInit()
{
IRCF1=1;
IRCF0=0;
ANSELB=0x00;
TRISB=0; PORTB=0;
TRISC=0;
T0IE=0;
}
void SetHT1632C_As3208()
{
CommandWriteHT1632C(SYS_EN);
CommandWriteHT1632C(LED_ON);
CommandWriteHT1632C(RC_MASTER_MODE);
CommandWriteHT1632C(N_MOS_COM8);
CommandWriteHT1632C(PWM_16);
}
void OutputCLK_Pulse()
{
B_CLK74164=1;
A_CLK74164=1;

NOP();
B_CLK74164=0;
A_CLK74164=0;

NOP();
}

static void CommandWriteHT1632C(unsigned int command)
{
unsigned char i;
unsigned int j;
command &=0x0fff;
ChipSelect(0);
NOP();
ChipSelect(-1);
for(i=0;i<12;i++)
{
CLK=0;
NOP();
j=command & 0x0800;
command = command <<1;
j =j >> 11;
DAT=j;
NOP();
CLK=1;
NOP();
}
ChipSelect(0);


}
static void AddressWriteHT1632C(unsigned char address)
{
unsigned char i,temp;
SSPCON=0x11;
address &= 0x7f;
CLK=0; NOP();
DAT=1; NOP();
CLK=1; NOP();
CLK=0; NOP();

DAT=0; NOP();
CLK=1; NOP();
CLK=0; NOP();

DAT=1; NOP();
CLK=1; NOP();
for(i=0;i<7;i++)
{
CLK=0; NOP();
temp=address &0x40;
address = address <<1;
temp = temp >>6;
DAT=temp; NOP();
CLK=1; NOP();
}


}
static void ChipSelect(int select)
{
unsigned char tmp=0;
if(select <0) //Enable all!
{
A_73164=(0);
B_73164=(0);
NOP();
for(tmp=0;tmp<CHIP_MAX;tmp++) OutputCLK_Pulse();
}
else if(select==0) //Disable All
{
A_73164=1;
B_73164=1;
NOP();
for(tmp=0;tmp<CHIP_MAX;tmp++) OutputCLK_Pulse();
}
else
{
A_73164=(1);
B_73164=(1);

NOP();
for(tmp=0;tmp<CHIP_MAX;tmp++) OutputCLK_Pulse();
if(select<=4) A_73164=(0);
else { B_73164=(0); select -=4;}

NOP();
OutputCLK_Pulse();
A_73164=(1);
B_73164=(1);
NOP();
tmp=1;
for(;tmp<select;tmp++) OutputCLK_Pulse();




}
}
void SPI_Model_Configure()
{
SSPIF=0; SSPCON=0x31; SSPSTAT=0x83;
}
void SPI_DataSend(const unsigned char data)
{
SSPBUF=data;
while(!SSPIF) ;
SSPIF=0;
}
static void AddToPanelData(unsigned char dotVal)
{
for(c =0; c<63;c++)
{
PanelData[c] = PanelData[c+1];
}
PanelData[63]=dotVal;
}
static void AddToRedPanelData(unsigned char dotVal)
{
for(c =0; c<63;c++)
{
RedPanelData[c] = RedPanelData[c+1];
}
RedPanelData[63]=dotVal;
}
 
Last edited:
From your original post your intension was not very clear (I was even wondering if you were actually selling the code!) and from time to time we see members requesting or sharing any available resources in private and that is why I had to make my point and ask you what was this all about.
You intension as you have explained was some kind of gathering of members interested in developing code for the specific board and helping each other, this can probably be done in this thread too since anyone else using the same board can contribute his code.
It is also up to any member to share his code or not but if he decides to share the code he should do it publicly so that all members can benefit.

Best regards
Alex
 

You intension as you have explained was some kind of gathering of members interested in developing code for the specific board and helping each other,
Exactly that my friend, shared development and knowledge sharing. I really cant' imagine I could sell the code as it comes free if you can be a**sed to type it in! !!! Who would buy it? Check my other posts for their "Sharingness"... You'll find I am a top bloke...

Neal

---------- Post added at 16:54 ---------- Previous post was at 15:43 ----------

 

DE-DP14211 is one of the better bicolor LED matrix boards I've seen for the money.

It looks like you could chain two or more units together. Have you tried or heard of anyone doing this polo-g40?
 
This is 2 units!
Some logic went into that bit I've gotta say!
NEAL
 

As you can imagine, logic is truely applied in all areas! The Datasheet (Superbly written) isn't too clear about using 2 units, it suggests having them in series but I've not got to trying to do it that way yet. Luckily the Datasheet had samples that worked enough for me to get to working out that the CS and CSClock pin on BR1 of the demoboard were easiest to control separately using the second BR2 connector. To start with I got both panels to display the same thing my making CsCLKB change everytime with CsCLKA and CSA and CSB, which made the same thing appear on both... A quick change to the "SelectPanel" routine (using CS/clk A for 1 to 4 and CS/clk B for 5 to 8) gave them seaparately....

There is schematics for the board suggesting that the CS line on the output connector is also the the ChipSelect(4) signal, so to do a serially-connected board I must have to selectChip4, and then un-CS that board and then do the CSClock pulses to select the chip, but I'm not nearly close to that attempt!!! The Osciloscope code can hande twice the ammouint of panels by stretching or looping, or by using a 4bit array for the history data instead of 'char', but the poor old chip just hasn't got much ramspace compared to the Atari ST I cut my teeth on and I think I'll be going up a level in pic when I try RGB!..!


I had neuro surgery about 6 weeks ago so the process of logging my progress and helping people is helping immensly, many thanks for your space EDA Board...

Regards
NEAL

---------- Post added at 20:02 ---------- Previous post was at 19:54 ----------

[q]if(!SW1 )
{
while(!SW1) { ; }
OscVal= OscVal+0x10;
if(OscVal>0x3f) OscVal=0x0f;
OSCCON=OscVal;
}

[/q]
This is my favorite bit of logic, speed change (timebase) in 5lines of code!
 
I appreciate the info. I have a contract bid for a possible project requiring panels such as these. If the bid is accepted, I may need to chain four of the units together. I guess I need to get my own hands dirty at that point.

Your tips and insights will definitely come in handy.

Very nice app! Keep it up.

I had neuro surgery about 6 weeks ago so the process of logging my progress and helping people is helping immensly, many thanks for your space EDA Board...

I hope you have a speedy recovery.

BigDog
 
I can recommend this setup, but I am close to the edge with resourses using the Sure-supplied demoboard. I recon I'm going to be PIC32 based if I go to RGB, I've seen a nice wireless-web-server board I think'll be next.

If you need anything at all just ask, I am happy to meet people with common interests, I'd love more projects to look at too if you get anything you'd be willing to co-operate on... :)

NEAL
 


This is a port of the "FrameBuffered" code I started on the single-color Panels! I had to shoehorn the code to get it to work on them, and now its been a nightmare!! I am using a uchar[] "PanelData" buffer to just give me the ficility of being able to have a "DrawDot" function!! BUT to get it in, I've had to split it into 4 separate named buffers each with 8 bytes!! So lots of code goes into doing everything 4 times for 32dots! :) I'd love you to have a look at the code if you ever get one of these setups but it really is stuck in there... I can't even add another bit variable without running out of space... I found that if the CONST char[] declaration that is "the display graphics" (I make the declaration using a c# progrette developed with my hungarian mate on another thread on here, KondorSz.! ) gets to more than 64bytes it'll run out of ramspace for some reason too!!

I have my not-framebuffered 1 color version to port (Which I had 150 characters of text in easily), can't wait to see that running, because I recon I'm going to have the "text oscilating with music!" A combination of the two projects! Hippies and ravers everywhere I am sure would love "Relax" and stuff to wave about with some "Orb" music!!! :p

Regards & Best wishes
NEAL
 
Right, I'm about to order off ebay a sure electronics do a pic24 Wireless webserver demoboard, its even got an SD slot... That's going to be the processor I'm going for next! It comes with sources and examples, made infinitely hackable, and the SD card'll at least give me an external framebuffer option in its raw form, but the demo-code has FAT reading bits in it so I could keep it as a file..! I'd love to be able to an do SPI read from the HTC chips (my next self-test on the single color 08x32 panels I've got) but the big panels dont have the read clock line.

Im about to sell this setup to someone with the "osciloscope" setup on for thier "tuesday night disco" for the special learners he works with. Recons will go down a treat, nice and calm. I've built it into a piece of black UPVC guttering that looks custom made to hold these boards! Cutting half an inch off each side of the LED boards means they slot in and out without strain, and the whole thing stands happily at just the right angle when laid on its edge. Some smoked perspex over the top has made it much more visible too, it darkens the big white shiny areas that are the matrix modules on these boards....

regards
Neal
 

Right, I'm about to order off ebay a sure electronics do a pic24 Wireless webserver demoboard, its even got an SD slot... That's going to be the processor I'm going for next! It comes with sources and examples, made infinitely hackable, and the SD card'll at least give me an external framebuffer option in its raw form, but the demo-code has FAT reading bits in it so I could keep it as a file..! I'd love to be able to an do SPI read from the HTC chips (my next self-test on the single color 08x32 panels I've got) but the big panels dont have the read clock line.

Hi Neal,

Do you have a link to the PIC24 Dev Board you've ordered? I'd like to check it out.

BigDog
 

**broken link removed**

Looks *superb*...! I've dpwnloaded thier demo-source and it included the Microchip IP stacks and all that so I recon I'll be programming at socket level in minutes!!! My 1st idea is just a telnet-able LED panel, but if the speeds up to it I might be able to send video to it..!!!

Regards mate, I appreciate your time:)
NEAL
ps Here is the "Monster" now!!! A bit of 6inch Black guttering and the stand off an old flat-screen monitor and I recon this looks like someone not idiotic has made it!!

P1000569.JPGP1000560.JPGP1000566.JPGP1000567.JPGP1000568.JPG
 

Well,
Look at this and tell me what you think, there is an effect in there you'll recognise from old-days-demos! I loveit but dont know what to call it... :)


All good I hope mate,
Neal
 
This is still on the PIC16 board.!! I've cut out the need for a frame buffer(128bytes), basically compiling the display on the fly, I've been watching the displays on the football on TV for ideas.! At least Leicester (My Home club!) isn't on the TV, we're not winning at all!!!

I woke up all excited thinking the WiFi board'd come, with the postman knocking at about 6:30 this morning, but was a pack of eBay source KoiCarp food I've just discovered!
I can't wait for the PIC24 setup, I recon I'm going to tag into the CF card slot on the board for the SPI link to the displays. Theres clock and data in & out and a CS on the slot, it's also got 5 LED's on board too, so I could tag into them for Panel-Select lines too for more displays..

Hope you are well mate! I can't wait to see the Pic24 results, with 16k of onboard memory I'm taking a massive "leap" forward!!! :p
NEAL



I've got a few digital cameras for scrappage, I'd like to read the CCD and display it on a panel next...!
 
This is a video of my biggest childhood influences as a background to all this "LED work"! :) .. I used to watch this, and similar, for hours listening to C&C Music factory and KLF. "The Care Bears" were a crew producing Demos on the Atari ST just as I started playing with 68000 (about 13years old) after years of Basic, (zx81/BBC/Spectrum/GFA on the ST). I got a Mod player source from one of them that went into with my 1st demo with scrollers and strobes and cubes! It gave me a real good knowledge of addressing practical "hardware" layouts, the ST was packed too, graphics hardware, midi (5v TTL serial!! Lots of fun with 2 ST's!), floppy controller and all sorts, this is why I had learned enough coding by the tme I got to college and Uni to teach the classes. (Lame lecturers, but knowing stacks and pointers and in-head binary put me well in front!)

I did have real fun with the Atari ..! :) eg To make the ST draw below the bottom of its normal screen, you could set the video window address to somewhere else and switch the RamDac to 60hz and back on the vertical blank interuipt (called overscanning) so it thought it'd started over and carries on writing data to the TV!! Also, to make the ST display more than 16 colors (pallette) I had to swap the colors in the pallette on the Horizontal Blank Interrupt, so a pallette for each line!

I hope I get simiilar fun with PIC's!! I dont want to produce games, just demos like my hero's!!
:)
NEAL
 
This is still on the PIC16 board.!! I've cut out the need for a frame buffer(128bytes), basically compiling the display on the fly, .....

I can't wait for the PIC24 setup, I recon I'm going to tag into the CF card slot on the board for the SPI link to the displays. Theres clock and data in & out and a CS on the slot, it's also got 5 LED's on board too, so I could tag into them for Panel-Select lines too for more displays..

I've got a few digital cameras for scrappage, I'd like to read the CCD and display it on a panel next...!

I'm looking forward to seeing the results new PIC24 dev board as well. So you removed the need for a frame buffer, I guess that freed up some storage.

What type of cameras do you have to use in the next phase, interface, resolution, etc?

BigDog
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top