[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 580: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 636: sizeof(): Parameter must be an array or an object that implements Countable
Brads Electronic Projects Forum • Getting started with programming pics in Basic - Page 2
Page 2 of 4

Posted: Wed Aug 11, 2010 12:32 pm
by brad
I should have got swordfish instead of proteus :cry:

Posted: Thu Aug 12, 2010 2:19 am
by FreeThinker
brad wrote: It's a nice piece of software isnt it!

It's quite straight forward to use and basic is such a nice language.

I had no idea about the plugin - where is that located / how do you access it?

Apparently they are developing a 24f series compiler but unsure of the release date.
http://www.sfcompiler.co.uk/wiki/pmwiki ... er.Plugins
It's the first item on the page.

Posted: Thu Aug 12, 2010 2:31 am
by FreeThinker
brad wrote: Apparently they are developing a 24f series compiler but unsure of the release date.
Sword Fish has not been updateed for over a Year .David Baxter the developer has not been on the forum for a LONG time.Rumours abound that he has abandoned the project due to work comittments.Check out the forum http://www.sfcompiler.co.uk and the links to the wiki.Main hope at the moment is that David releases the source code to a third party developer or the sword fish community,we can only wait and see.Hope it suvives as a product as it it so much easier than Proton (picbasic) or Mikrobasic.

Posted: Thu Aug 12, 2010 3:44 am
by bitfogav
Sword Fish has not been updateed for over a Year .David Baxter the developer has not been on the forum for a LONG time.Rumours abound that he has abandoned the project due to work comittments.Check out the forum http://www.sfcompiler.co.uk and the links to the wiki.Main hope at the moment is that David releases the source code to a third party developer or the sword fish community,we can only wait and see.Hope it suvives as a product as it it so much easier than Proton (picbasic) or Mikrobasic

Yeah ive seen a few forums stating all kinds of romours, but I have read that David Baxter (SF developer) had a good reason he was away for a while which was personal, that is just a statment from Steven, who is the swordfish forum Moderator..

Posted: Tue Aug 17, 2010 9:52 pm
by FreeThinker
bitfogav wrote: Yeah ive seen a few forums stating all kinds of romours, but I have read that David Baxter (SF developer) had a good reason he was away for a while which was personal, that is just a statment from Steven, who is the swordfish forum Moderator..
First an apology to David, its David Barker no Baxter,Sorry :oops: my Bad!
I really like swordfish and will use it a lot more when I grow into the 18f family.Only using the 16f family at the moment as that is my dev hardware platform for time time being.Tried some example code for the LCD and found that it (sf) did not support "scrolling" of the screen, text slicing was the only way forward.Closer examination of the code (the inc lcd.bas file) showed a list of public constants and a command( ) function.This code sent a command code to the lcd then a data byte for the required action ie cls, move cursor, etc. It was a simple matter to declare a couple of constants in the program and call command(new constant) to implement the scroll screen right or left.This was possible ONLY because the source code for the library routines is supplied.It would a be a simple matter to include these new constants in the include file file and have them available to all routines.This is truly awesome openess and makes sf so very powerful.

Posted: Tue Aug 17, 2010 10:10 pm
by brad
That's some very handy info there, thanks for sharing :)

It is fantastic that all the user modules are open source which means you can do exactly what you were talking about - modify them to suit your needs.

We were discussing a while ago about how to get scrolling text via swordfish, and perhaps we now have our answer :)

Posted: Tue Aug 17, 2010 11:44 pm
by FreeThinker
brad wrote:That's some very handy info there, thanks for sharing :)

It is fantastic that all the user modules are open source which means you can do exactly what you were talking about - modify them to suit your needs.

We were discussing a while ago about how to get scrolling text via swordfish, and perhaps we now have our answer :)
Urm don't know about the library files being open source, just the source code is available.Think DB still retains copyright.The files are locked (ie read only) not a big problem but intended to protect the files.Backup any mods first :D.I will post more details if required but basically all I did was create two constants:-

Code: Select all

 Public Const
 cmdDisplayRight = %00011100,
 cmdDisplayLeft = %00011000
(no real need to make them public )

Then a call such  as Command(cmdDisplayRight) will scroll right (string moves to the LEFT)
Here is the code as I bashed it about for testing.

// if device and clock are omitted, then the compiler defaults to 
// 18F452 @ 20MHz - they are just used here for clarity...
Device = 18F452
Clock = 20
#define isis_used
// some LCD options...
#option LCD_DATA = PORTB.4
#option LCD_RS = PORTB.3
#option LCD_EN = PORTE.2
Dim index As Byte
// import LCD library...
Include "LCD.bas" 
Include "utils.bas"
'The Two Constants below should be added to the LCD.bas INC files Later
 Public Const
 cmdDisplayRight = %00011100,
 cmdDisplayLeft = %00011000
// program start...
SetAllDigital
Cls()
DelayMS(250)
WriteAt(1,1,"Hello World this line is 40 characters *Wot happens next?")
DelayMS(1000)
Command(cmdBlinkOn)
loop:
Command(cmdDisplayRight)
DelayMS (1000)
GoTo loop
The line Hello World is 40 characters long to the * so what does happen next? :D .Think the original code is a SF sample file.
As I have seid before I DON'T have an 18F platform to test so I used the Oshon 18F simulator after removing the delays as it is not real time.It works as expected but is only a simulation.

Posted: Tue Aug 17, 2010 11:52 pm
by FreeThinker
FreeThinker wrote: As I have seid before I DON'T have an 18F platform to test so I used the Oshon 18F simulator after removing the delays as it is not real time.It works as expected but is only a simulation.
Opps forgot to put link to Oshon site http://www.oshonsoft.com/

Posted: Wed Aug 18, 2010 6:16 am
by brad
This is so cool!

It's such a simple solution to a problem that I couldn't figure out. The good thing is that I have a use for it with my LED games - thanks very much for posting. :D

I am guessing that these two 8-bit numbers are specific commands built into the LCD displays:

Code: Select all

%00011100,
%00011000 
Is that right?

Posted: Wed Aug 18, 2010 7:46 am
by FreeThinker
brad wrote:This is so cool!

It's such a simple solution to a problem that I couldn't figure out. The good thing is that I have a use for it with my LED games - thanks very much for posting. :D

I am guessing that these two 8-bit numbers are specific commands built into the LCD displays:

Code: Select all

%00011100,
%00011000 
Is that right?
When power is applied to the lcd display it runs its internal init routine and defaults to an 8 bit data bus with its display cleared and pointing to its first memory location.Any data received is now used to index into an internal character map and the bit pattern copied to the current cursor location and then incremented.Certain data is interperated as a command code and thedisplay switches to command mode.the next data byte is then decoded as the required action.When completed the display returns to its previous mode.You can clearly see how the function command(data) now works all you need to know now is the command code list.90% of displays are based on the industry standard hd44780 by hitachi, cloned by many others.You need to find the data sheet for your display and check.I've attached the data sheet for the lcd controller for my display which is the same as most others, page 13 has a nice table of codes.Happy reading.
PS How will these (LCD Specific) commands help with a Led Matrix, are they controlled with a hd44780?

Posted: Wed Aug 18, 2010 7:51 am
by bitfogav
When power is applied to the lcd display it runs its internal init routine and defaults to an 8 bit data bus with its display cleared and pointing to its first memory location.Any data received is now used to index into an internal character map and the bit pattern copied to the current cursor location and then incremented.Certain data is interperated as a command code and thedisplay switches to command mode.the next data byte is then decoded as the required action.When completed the display returns to its previous mode.You can clearly see how the function command(data) now works all you need to know now is the command code list.90% of displays are based on the industry standard hd44780 by hitachi, cloned by many others.You need to find the data sheet for your display and check.I've attached the data sheet for the lcd controller for my display which is the same as most others, page 13 has a nice table of codes.Happy reading.
PS How will these (LCD Specific) commands help with a Led Matrix, are they controlled wit a hd44780?
wheres tha datasheet?

Posted: Wed Aug 18, 2010 7:54 am
by FreeThinker
bitfogav wrote:
When power is applied to the lcd display it runs its internal init routine and defaults to an 8 bit data bus with its display cleared and pointing to its first memory location.Any data received is now used to index into an internal character map and the bit pattern copied to the current cursor location and then incremented.Certain data is interperated as a command code and thedisplay switches to command mode.the next data byte is then decoded as the required action.When completed the display returns to its previous mode.You can clearly see how the function command(data) now works all you need to know now is the command code list.90% of displays are based on the industry standard hd44780 by hitachi, cloned by many others.You need to find the data sheet for your display and check.I've attached the data sheet for the lcd controller for my display which is the same as most others, page 13 has a nice table of codes.Happy reading.
PS How will these (LCD Specific) commands help with a Led Matrix, are they controlled wit a hd44780?
wheres tha datasheet?
Whoa! you are Quick....Edited posting original would not take pdf files :D

Posted: Wed Aug 18, 2010 7:57 am
by bitfogav
HaHa! I was just interested in this because I have used LCDs alot in assembly and I have now switched to swordfish so this would be very usefull :)

and oh yeah i dont think you can upload PDF files on this forum hehe.

Posted: Wed Aug 18, 2010 8:03 am
by FreeThinker
bitfogav wrote:HaHa! I was just interested in this because I have used LCDs alot in assembly and I have now switched to swordfish so this would be very usefull :)

and oh yeah i dont think you can upload PDF files on this forum hehe.
Has the attachment worked?I cannot see it' but is there in preview?

Posted: Wed Aug 18, 2010 8:05 am
by bitfogav
FreeThinker wrote:
bitfogav wrote:HaHa! I was just interested in this because I have used LCDs alot in assembly and I have now switched to swordfish so this would be very usefull :)

and oh yeah i dont think you can upload PDF files on this forum hehe.
Has the attachment worked?I cannot see it' but is there in preview?
No sorry buddy it hasn't worked, do you have a link to the PDF file ?