Propellor Clock POV Style Display Example Code

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

Sir nothing happened.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Do you maybe need some delays in there? Otherwise your program looks fine. Are you getting compile errors still or is nothing happening on the chip? Could it be a config issue?

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

pov test.c(166): error: failure


It is not compiling in any way. I put rom char* in supplementary code. void printChar(char letter) in function imiplementation. It did not compile. I also tried to put all code on c block and void printChar(char letter) in main c code block, but compiler does not compile. Sir, if you get a bit time free, plz put it in your program and compile to see if it is working or problem with demo flowcode v5.

There should be lession or tuturial on c block work eg; how to use c code block if someone tries to convert a mickro C program to flowcode, what changes should be make and what to consider.

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

Got it, i compiled it.

Sorry to disturb u.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,

The problem with a tutorial etc is that every compiler is different and they seem to change the way of doing things too so that it may work in one version but not in the next.

Glad you got it working though.

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

Great to know that you are keeping eye on my progress and helping me out!! thanks.

I did make complete LUT table from c file of glcd as:

ROMARRAY_S gLCD_1_ASCII7 ROMARRAY_E = {.....} etc
ROMARRAY_S gLCD_1_ASCII8 ROMARRAY_E = {.....} etc
etc

When compiled it showed
RAM available:368 bytes, used:43 bytes (11.7%), free:325 bytes (88.3%),

when the same table was made with rom char* it was error of insufficient ram.

What is ROMARRAY_S and ROMARRAY_E. Is is custom boostc command for flowcode and if so how to use it as when i made LUT with ROMARRAY_S AAAAA = {.....}; etc.. full LUT talbe as in glcd. It compiled with less RAM use.

Plz explain ROMARRAY_S and ROMARRAY_E as it is not in tutorial or forum, as it is great to make large LUT with less RAM usage and why not we should use it instead of rom char*?

I hope this query will help a lot in forum.

Thanks in Advance !!!!!
Last edited by mtqc76 on Fri Sep 14, 2012 2:59 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,

If your using BoostC (the deafult Flowcode PIC compiler) and creating your ROM arrays like this.

rom char * data = {0x00,0x00,0x00,0x00};

Then the variable should be being stored into ROM and not RAM.

Are you using other variables in your program that could be eating up all your RAM e.g. a screen buffer array or anything like this?

If you attach your Flowcode or C file to your next post then hopefully I will be able to help you a bit better.

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

sir i got the solution, i edited the last post and it is working fine in proteus, project is not complete yet but i will ask you if i get stuck. anyhow thanks for great help.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,

For BoostC the definitions look like this.

Code: Select all

#define MX_STRING 		unsigned char*
#define ROMARRAY_S				rom MX_STRING
#define ROMARRAY_E
For HiTech they are like this.

Code: Select all

typedef unsigned char  	MX_UINT8;
#define ROMARRAY_S				const MX_UINT8
#define ROMARRAY_E				[]

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

Plz in little detail specific to:

1. Difference between rom char* and ROMARRAY_S and ROMARRY_E and significance.
2. Cannot we use ROMARRAY_S and ROMARRY_E instead of rom char* to free RAM.


Sir, I have managed to make a clock and for dummy first to display second. i am currently using 628a portb for it. i want to know what i have to do ie configure so that all pins of porta be available as ouput pin and use internal oscillator. I tweak the oscillator configuration for internal oscillator, seems working, but how to enable all i/o pin of porta.


Thanks in advance.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,

I was trying to show you that "rom char*" and "ROMARRAY_S" are the same things, so you can use either.

You should be able to use a output icon to control the port a pins.

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

sir need one query more:
i want to make a routine to print icon in c block.

char SMILE: (why need to char SMILE? without it does not compile and compiler tells that it may be used without initializtion)
printIcon(SMILE);




in defination and function declaration:


ROMARRAY_S SMILE ROMARRAY_E= {0,0,126,129,129,137,133,165,133,133,133,165,133,137,129,129,126,0};


in function implementation:

void printIcon(char icon)
{
int n;


for(n=0;n<18;n++){

if(icon == SMILE) portb = SMILE[n];
} }

problem is that it compiled, but in sumulation on proteus it does not work. It is not getting SMILE table.

It is working if I make it this way printIcon('S'); and if(icon == 'S') portb = SMILE[n];

What is wrong, how should it i use first method?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,

The problem is that this will not work "if(icon == SMILE)" because smile is a byte array and you are comparing with a char variable. The name of the variable is inconsequential to the compiler so it is looking for a type char variable with the name SMILE.

I would maybe do it like this.

Code: Select all

#define MAX_ICONS 1
ROMARRAY_S ICON0 ROMARRAY_E= {0,0,126,129,129,137,133,165,133,133,133,165,133,137,129,129,126,0}; 
#define ICON0_SIZE 18

void printIcon(char icon)
{
	int n;
	if (icon >= MAX_ICONS)
		return;
	for(n=0;n<ICON0_SIZE;n++)
	{
		if(icon == 0) portb = ICON0[n];
	} 
}
This way you can add more icons and index them from 0 to the max number of icons - 1.

eg.

Code: Select all

#define MAX_ICONS 3
ROMARRAY_S ICON0 ROMARRAY_E= {0,0,126,129,129,137,133,165,133,133,133,165,133,137,129,129,126,0}; 
#define ICON0_SIZE 18
ROMARRAY_S ICON1 ROMARRAY_E= {0,0,126,129,129,137,133,165,133,133,133,165,133,137,129,129,126,0}; 
#define ICON1_SIZE 18
ROMARRAY_S ICON2 ROMARRAY_E= {0,0,126,129,129,137,133,165,133,133,133,165,133,137,129,129,126,0}; 
#define ICON2_SIZE 18

void printIcon(char icon)
{
	int n;
	if (icon >= MAX_ICONS)
		return;
	if(icon == 0)
	{
		for(n=0;n<ICON0_SIZE;n++)
		{
			portb = ICON0[n];
		}
	}
	if(icon == 1)
	{
		for(n=0;n<ICON1_SIZE;n++)
		{
			portb = ICON1[n];
		}
	}
	if(icon == 2)
	{
		for(n=0;n<ICON2_SIZE;n++)
		{
			portb = ICON2[n];
		}
	}
}

mtqc76
Posts: 48
Joined: Fri Jun 17, 2011 11:44 am
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mtqc76 »

great sir; its working......

printicon(0);printicon(1); etc.......

what if i want to make readable command like
printicon(smily);
printicon(funny); for know what i am printing on POV for ease. I think there should be way to do it.....Your last post really did increase knowledge and i am feeling comfortable now in grasping project and its theory how pov works.....thanks you..

Is there a directory or pdf which contain information of boostc/hi-tech compiler definations, syntax etc for reference and its example to know how to use it with reference to flowcode?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,
what if i want to make readable command like printicon(smily);
I don't think there is a way of doing this without using a lot of variables (not recommended due to RAM usage) or defines. You could create variables or definitions (v5 onwards) called the various names and then pass the names when calling the function.

Here is a v5 example using defines.
ss1.jpg
ss1.jpg (24.15 KiB) Viewed 24742 times
ss2.jpg
ss2.jpg (43.28 KiB) Viewed 24742 times
Is there a directory or pdf which contain information of boostc/hi-tech compiler definations, syntax etc for reference and its example to know how to use it with reference to flowcode?
In the main BoostC folder is a file called boostc.pdf which is a manual for the compiler.

The v5 BoostC folder is located here.
C:\Program Files (x86)\Flowcode\v5\Tools\boostc

The v4 folder here.
C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\boostc

mhatab
Posts: 2
Joined: Wed Aug 28, 2013 12:13 pm
Been thanked: 2 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mhatab »

Good Project , my Project like it ,i used pic 16f877a with wireless power ,and remote control to change the style ....

not finished yet

[/youtube]

[/youtube]

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Wow, well done that looks really fantastic! Many pats on the back deserved for that one I think :D

Can I ask what you used as your motor and wireless power provider? I think the main issue with mine is the motor, though cheap, has to be heavily engineered and then has a fairly low life expectancy due to the current running through it.

mhatab
Posts: 2
Joined: Wed Aug 28, 2013 12:13 pm
Been thanked: 2 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by mhatab »

i used motor for old big printer ,this is motor picture :
DSC02580.jpg
(102.76 KiB) Downloaded 10188 times
DSC02579.jpg
(112.02 KiB) Downloaded 10188 times
DSC02578.jpg
(119.13 KiB) Downloaded 10188 times
and In Shaa Allah , the wireless power in the next time will explain how to build it . :arrow:

thetallstumpyone
Posts: 3
Joined: Mon Oct 27, 2014 11:21 am
Has thanked: 1 time
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by thetallstumpyone »

I couldn't seem to find much information on the IR you used to send wireless signals to the clock? I would like to know the IR device you used and how it was set up on the PCB? Also how did you send the data to it?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Propellor Clock POV Style Display Example Code

Post by Benj »

Hello,

I used the same IR receiver circuit as on the EB060 IR Board. If you refer to the datasheet for the EB060 then it should contain a circuit diagram on how to wire up the receiver.

The code is then done via the RC5 Flowcode component. Any off the shelf RC5 based transmitter should then work with the receiver. Or you could use the RC5 component in transmit mode to create your transmitter.

Post Reply