My first C3 project?
Rsadeika
Posts: 3,837
It has to be an OS (PropOS) for the C3 board. Since the C3 is readily available, and fully assembled, I think there will be more people that would be interested. I think it is best to start from scratch, that way you will not have to change pin assignments in the source code, which in a larger program, becomes error prone. I believe the standard should be for a VGA system with a keyboard and mouse. More people have extra VGA screens laying around then TV sets with the proper hookup.
I looked around, and there are PS/2 keyboard/mouse y-splitter cable that is available, so, the missing first item would be a driver for that device. Since there is a driver for the VGA, that is ready to go. The other thing that would be necessary is to be able to create a bootable uSD card, that way you have your OS on the card, plug it in, turn on the C3, and you are ready to go.
Now where do you go from here, I am thinking that a CLI/semiGUI, would be a good start. It would be a standard CLI, you type in commands, and the semiGUI would be some similar to the Edit programs that are used on a DOS box. When you open the Edit program you can use the mouse for cut/paste, file save, and that sort of stuff. Part of the command structure, you would need a 'Run' command, that way you could load other programs, and run them without to much hassle.
This is my outline, is anybody thinking along the same lines? I guess we can start a discussion about this, before to many people start to duplicate efforts.
Thanks
Ray
I looked around, and there are PS/2 keyboard/mouse y-splitter cable that is available, so, the missing first item would be a driver for that device. Since there is a driver for the VGA, that is ready to go. The other thing that would be necessary is to be able to create a bootable uSD card, that way you have your OS on the card, plug it in, turn on the C3, and you are ready to go.
Now where do you go from here, I am thinking that a CLI/semiGUI, would be a good start. It would be a standard CLI, you type in commands, and the semiGUI would be some similar to the Edit programs that are used on a DOS box. When you open the Edit program you can use the mouse for cut/paste, file save, and that sort of stuff. Part of the command structure, you would need a 'Run' command, that way you could load other programs, and run them without to much hassle.
This is my outline, is anybody thinking along the same lines? I guess we can start a discussion about this, before to many people start to duplicate efforts.
Thanks
Ray
Comments
What I would like to have is a bootable uSD card, but, I think I remember that when the Propeller starts, it only checks the EEPROM, is this a correct assumption? I started looking at the source for the C3, and it looks like AndreL has covered everything, so, if I have to create a boot program, that will reside in the EEPROM, I think there is enough source examples to give it a shot.
What I will try to accomplish is a bootable uSD card, keyboard with a VGA monitor, that will boot up, and accept some commands from the keyboard (maybe one command). That should keep me busy for a couple of months LOL.
Ray
So I have a simple boot program in the eeprom that starts up and prints a message on the screen saying "Type Help for command listing". Then you can read the help and see quite easily how to run binary programs off the sd card (just type the name of the file).
I think it might be easier than that!
If you use Kyedos you would need to:
1) remove the references to the LCD display
2) change references to pins in the CON section
3) add in a tiny bit of code on startup that resets the counter so the default device is the sd card
Take a look at the Kyedos thread if you want something to start from. http://forums.parallax.com/showthread.php?128779-KyeDOS-an-operating-system-for-the-Propeller Then start pulling it to bits!
Ray
I should mention that there is a programming complexity, at least for me, around the coding of the MUX. I have to decide if the MUX code should be in its own object, or if a PUB or PRI should suffice. By complexity, I mean, you have to turn on/off pins before you can use them. Other than that it looks like this could be a lot of fun.
On another note, I am surprised that Parallax did not provide an enhanced Propeller IDE for handling the C3. This is a great little board, but if you have to "pull teeth" in order to use all that is available on the board, you might run into some resistance for greater sales. Just my opinion, for what it is worth.
Ray
I wouldn't say setting one bit is pulling teeth to select the VGA or IO And other than that, everything works thru spi, with examples of everything in my book. So, something that's advanced enough to use the new features can use them immediately, where newbies can just use the core propeller features as they would anything until they get comfortable and want to try the other peripherals. I am not sure what we would do the IDE to support the C3 specifically, or any other Propeller board for that matter. The C3 is like anything else, but just has a lot of stuff. So, when you say to yourself, I want to do "this" - first look in my manual on the "this" see if there is a demo, check it out real quick, the 3-5 overview of every system will save you a lot of time and then try it.
Moreover, the IO configuration of the C3 mimics the two most popular boards for the Prop; the demo board and HYDRA, so 90% of all objects work untouched or with a change to the start function. The other new peripherals and the SPI bus are really a new "standard" for the Propeller platform, so as time moves on people will modify drivers and other higher level functions to have built in support for the SPI bus selection logic. And I think that a lot of people will use this SPI bus design with mux/selection logic as the basis of their designs, so things will go in that direction.
But, like I said, modifying the IDE to support any board specifically isn't really a problem, the problem is WHAT what the IDE do differently other than have a section in the HELP on the board, but that's what the C3s manual is for.
Now, a NEW ide that uses a different language like BASIC, Forth, etc. that has built in functions and a base set of drivers for dealing with the C3 that's a good idea. But, that's a LOT of work. Maybe something you want to tackle? Take one of these languages for the Prop that runs from a command line, wrap ecplise or a java tool around it, and then build an API and driver model, so from the users point of view they are just coding like this:
handle = Open_File( "sd", channel_n, mode_bits)
handle = Write_File( handle, data)
Or the SRAM is integrated into the memory model so when you declare something, you can do this:
VAR BYTE data_array[100] // normal array in local hub RAM
VAR BYTE SPIRAM data_array2[100] // this array is stored in SPI RAM
data_array[1] = 100 // stores a 100 in location 1 of local array
data_array2[56] = 200 // stores a 200 in location 56, but syntax is the same, compiler creates code to access the SPI ram for programmer transparently.
etc. stuff like that, I think that would be great. A new IDE, use a BASIC or CBASIC language, and put 100% support for the C3 and any other C3 like device with SPI bus peripherals.
Andre'
I will keep poking around ...
Ray
I guess this is all at the cutting edge, so a lot of things have not been written yet.
I've mentioned Kyedos a few times. This is not perfect either, but what it does is link together a number of Obex objects that have been proven to work well. One of those is an 80x40 vga character display, which I think is one of the things you are looking for.
I don't think you need a new IDE to do this. Just some customised code that is specific for the C3. I think mainly that revolves around the SPI device selection.
Using the external ram might come later, though I think it might be working already with C.
I'm not sure you can detect whether a TV or VGA is connected, but what you could do is include the code for both and then have one value in the CON section that you can change to select which one it uses.
Andre'
Andre'
For TV you can set one of the 3 resistors to High output and then read in another of the 3 TV-Pins. If the Pin is high nothing is connected, if it is low there must be a TV with a 75 Ohm input resistance which pulls the line to Low:
For VGA I use the fact that my Monitor has PullUps on the H- and V-sync inputs. So I write a Low to the V-sync and switch it then to input. If it is still low, no Monitor is connected, otherwise there must be a VGA monitor which pulls the line high. Not sure if all Monitors have pullups. Andy
Edit: I think this VGA detection is not possible on the C3 because of the Tristate buffer in between.
Andre'
Ray
Andre'
Code:
Andre'
Ray
In general, every peripheral on the C3 I wrote a chapter and demo about, so just read up, then you can integrate anything you want.
Andre'
Now I will proceed with trying to get the battery connected to the AD connector, and hopefully I will get the LEDs to show the battery charge level. After I get that to work, then I will be moving the platform on to the robot, and see if it all works the way I expect it to work.
Ray
Ray
Ray
A couple things. First, I would start with something WORKING -- then add a tiny bit of code, make sure it WORKS then a tiny bit more.
Also, on your question about voltage dividers, not sure what you are asking, but voltage dividers work on the ohms law etc. they aren't magic, so if you put a load on one of the resistors this CHANGES the resistance and thus the voltage divider action. So, either you need zener diodes if you want some modicum of regulation, or real regulators, or you need to "tap" your voltage divider with a very high impedance probe like an Op Amp and then use the output of that as your voltage, this way you "buffer" the signal and don't draw current from the voltage divider.
ANdre'
Ray
I attached a picture of my wiring harness, I think the professionals will be amused.
Goto Radio Shack and get a 5 volt regulator from the parts drawer. Output will be 5 volts for any current up to one amp.
Jim