Getting started with programming pics in Basic
Moderators: Chuckt, Garth, bitfogav
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
http://www.sfcompiler.co.uk/wiki/pmwiki ... er.Pluginsbrad 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.
It's the first item on the page.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
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.brad wrote: Apparently they are developing a 24f series compiler but unsure of the release date.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
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..
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
First an apology to David, its David Barker no Baxter,Sorry my Bad!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..
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.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
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
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
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
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 .I will post more details if required but basically all I did was create two constants:-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
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
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.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Opps forgot to put link to Oshon site http://www.oshonsoft.com/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.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
- brad
- Site Admin
- Posts: 2578
- Joined: Fri Mar 26, 2010 10:30 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
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.
I am guessing that these two 8-bit numbers are specific commands built into the LCD displays:
Is that right?
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.
I am guessing that these two 8-bit numbers are specific commands built into the LCD displays:
Code: Select all
%00011100,
%00011000
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
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.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.
I am guessing that these two 8-bit numbers are specific commands built into the LCD displays:
Is that right?Code: Select all
%00011100, %00011000
PS How will these (LCD Specific) commands help with a Led Matrix, are they controlled with a hd44780?
- Attachments
-
- CM200400GFAYC-01.zip
- Page 13 gives some good Tables
- (497.05 KiB) Downloaded 703 times
Last edited by FreeThinker on Wed Aug 18, 2010 8:01 am, edited 3 times in total.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
wheres tha datasheet?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?
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Whoa! you are Quick....Edited posting original would not take pdf filesbitfogav wrote:wheres tha datasheet?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?
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
-
- decided to stick around...
- Posts: 25
- Joined: Mon Aug 02, 2010 1:13 am
- Location: UK [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Has the attachment worked?I cannot see it' but is there in preview?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.
Machines were mice and men were Lions once upon a time........But now that it's the opposite its twice upon a time. MooNDoG
No sorry buddy it hasn't worked, do you have a link to the PDF file ?FreeThinker wrote:Has the attachment worked?I cannot see it' but is there in preview?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.
Who is online
Users browsing this forum: No registered users and 1 guest