Scrolling Text

General discussion on mikroBasic.
Author
Message
supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#16 Post by supra » 22 Mar 2010 01:46

scrolling messages vertical up from bottom to top right

Project name:
' vertical up from centre to top right
' ' ' * Description:
' This code demonstrates scrolling messages vertical up from bottom to top right
' on 8x32 dor matrix, 2x74hc154.
' * Test configuration:
' MCU: PIC16F628A
'' Oscillator: HS, 20.000 MHz
' config: PWRITE_ON, WDT_OFF, LVP_OFF, HS
' Ext. Modules: None
' SW: mikroBasic v7.2
' date: March 18th, 2010
' * NOTES:

program vertical_up_centre_to_top_right

const supra as byte[30] = (
$00, $46, $49, $49, $49, $31,' // S
$00, $3F, $40, $40, $40, $3F,' // U
$00, $7F, $09, $09, $09, $06,' // P
$00, $7F, $09, $19, $29, $46,' // R
$00, $7E, $11, $11, $11, $7E)' // A

dim i, x as byte
dim temp_array as byte[32]
dim shift, a, value, column as integer

main:

'Set int Port operations
trisb = 0
trisa = 0
portb = 0
porta = 0
cmcon = 7

i = 0
a = 0
x = 0
column = 0
shift = 0
value = 0

start:
' Calculate the number of columns in the text
column = 30
'Temporary array reset
for i = 0 to 31
temp_array = 0 'Array elements start out 0
next i

while true
'Shift operations
for shift = 0 to column 'prolong spaces to repeat again

'32 columns of text divided into pieces
for i = 0 to 31
value = i - shift
if(value > 0) then
temp_array = 0 ' text input
end if

if(value >= 0) and (value <= column - 1) then
temp_array = supra[value]
end if

if(value > column) then
temp_array = 0
end if
next i

'Scanning process
for a = 0 to 35 'control scrolling speeds...highuer number is slowest and lowest number is fastest
for x = 0 to 31 'Temporary array view
ClearBit(PORTA, i) 'Clear the Ghost locations ready for starting
portb.i = 0
portb = temp_array[x] >> shift 'send data to PortB
porta = x 'select the corresponding column
Next x
nop
nop
' delay_us(1000)
next a
next shift
wend
goto start
end.

youtube:
http://www.youtube.com/watch?v=XLCAeZyk6Uw

aeddy
Posts: 3
Joined: 23 Mar 2010 04:31

Re: Scrolling Text

#17 Post by aeddy » 23 Mar 2010 04:42

hye supra..
im new in LED programming but i want to learn about it for my project..
base on ur project, can we use 5x30 dot mtrix that using PIC16F628A interface from keybord?..
i mean we enter our word from keyboard..
can u givev me example for code source and circuit diagram using keyboard..
coz i try to goole it, but nothing..cz all using different PIC..
plz help me..
i really need it..

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#18 Post by supra » 23 Mar 2010 10:08

aeddy wrote:hye supra..
im new in LED programming but i want to learn about it for my project..
base on ur project, can we use 5x30 dot mtrix that using PIC16F628A interface from keybord?..
i mean we enter our word from keyboard..
can u givev me example for code source and circuit diagram using keyboard..
coz i try to goole it, but nothing..cz all using different PIC..
plz help me..
i really need it..
Yes! U can used 5x30 interface with keyboard. It can be found in help files. Actually I haven't tried with keyboard. Because i'm moving into mikroBasic pro and mikroBasicdsPIC30 pro.

http://www.uelectronics.info/pic-interface-at-keyboard

here is source code for keyboard:
Note it is only for pcBAsic,. But u may have to modified.
http://users.picbasic.org/Howto/PC_keybrd/KYBD_2.bas

U may gave to translates from C to Basic:
http://www.ccsinfo.com/forum/viewtopic.php?t=27544

wireless keyboard tutorial:
http://instruct1.cit.cornell.edu/course ... elessKybd/

aeddy
Posts: 3
Joined: 23 Mar 2010 04:31

Re: Scrolling Text

#19 Post by aeddy » 23 Mar 2010 11:39

thanks supra..
i will try..
later on i will post my project progress to share anybody..huhu..

but how i want to change your coding into my project..
now i using 2mhz and 5x7 led...
base on your coding is 20mhz and 8x8..
can you give me example..

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#20 Post by supra » 23 Mar 2010 11:47

aeddy wrote:thanks supra..
i will try..
later on i will post my project progress to share anybody..huhu..

but how i want to change your coding into my project..
now i using 2mhz and 5x7 led...
base on your coding is 20mhz and 8x8..
can you give me example..

Here is schematic:
download pdf files:
http://www.electronic-engineering.ch/m ... d_V2xx.pdf

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#21 Post by supra » 23 Mar 2010 11:56

aeddy wrote:thanks supra..
i will try..
later on i will post my project progress to share anybody..huhu..

but how i want to change your coding into my project..
now i using 2mhz and 5x7 led...
base on your coding is 20mhz and 8x8..
can you give me example..
U can modified urself to suit ur codes.
The chip i used is 16F628A i/p20 Can used from 8 to 20Mhz

If u r using 2mhz. U must change speed.
.
.
.
for a = 0 to 35 'control scrolling speeds...higher number is slowest and lowest number is fastest I used 20Mhz


.
.
.

I do not have 2mhz osc with me. All i have is 4, 8, 10, 12, 20Mhz

aeddy
Posts: 3
Joined: 23 Mar 2010 04:31

Re: Scrolling Text

#22 Post by aeddy » 23 Mar 2010 12:45

so if i change to 4mhz with 5x7 led..
so what i need to change the coding?..

btw, i try to build ur coding using micro c..
it out many error..

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#23 Post by supra » 23 Mar 2010 13:56

aeddy wrote:so if i change to 4mhz with 5x7 led..
so what i need to change the coding?..

btw, i try to build ur coding using micro c..
it out many error..
The 4mhz is good for u. But 2 mhz seemed slowly for sending to output.

email me with ur code.

chocolate
Posts: 2
Joined: 23 Mar 2010 15:37

Re: Scrolling Text

#24 Post by chocolate » 23 Mar 2010 15:44

hello supra..

i try use ur coding..
but i got error..
is there any command that i miss?..
can u gv me a complate of ur coding?
im beginner in mirco c..

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#25 Post by supra » 23 Mar 2010 18:15

chocolate wrote:hello supra..

i try use ur coding..
but i got error..
is there any command that i miss?..
can u gv me a complate of ur coding?
im beginner in mirco c..
I merely started with mikroBasic.
This code was written completely in mikroBasic but never written in mikroC

What the error message?
This is the only codes that is completed everything that i posted on this forum.
There r no commands missing in mikroBasic, but missing must be found in mikroC.

There must be syntax error:

From basic to C:
for while true ===> for(;;)

dim temp_array as byte[32] ==> unsigned char temp_array[32] ;
dim shift, a, value, column as integer ==> int shift, a, value, column;

dim i as byte ==> unsigned char i = 0 ;
i = 0

If not check portA:
porta = x ==> portA = PORTA <<1;

chocolate
Posts: 2
Joined: 23 Mar 2010 15:37

Re: Scrolling Text

#26 Post by chocolate » 24 Mar 2010 09:57

oh..i c..
sory..
btw, did u use transisitor for ur circuit?
can i know what type transistor that u use?

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#27 Post by supra » 24 Mar 2010 14:14

chocolate wrote:oh..i c..
sory..
btw, did u use transisitor for ur circuit?
can i know what type transistor that u use?
.
I don't used transistors. U don't needed this. Because of shift register can limited to 20 mA output.
Or u can used network resistors or uln2003. This will helped reducing components

If u want to used transistors u can used general transistors (npn or pnp), such 2n222, 2n3906(pnp), etc. The output is taking from emitter(Common Emitter), because of constant current and it is digital not analog


If u r not familiar or u r not electronic technician engineering or technology
http://www.kpsec.freeuk.com/trancirc.htm

or search google transistor tutorial or go to library.

abdallah205
Posts: 5
Joined: 15 Feb 2014 17:06

Re: Scrolling Text

#28 Post by abdallah205 » 05 May 2014 17:44

excellent work :)

supra
Posts: 187
Joined: 08 Apr 2009 11:54
Location: Ontario, Canada

Re: Scrolling Text

#29 Post by supra » 06 May 2014 14:15

abdallah205 wrote:excellent work :)
Thank you.

Just to let u know that i'm moving into arm11
salaam
Supra

Post Reply

Return to “mikroBasic General”