Shop OBEX P1 Docs P2 Docs Learn Events
What could we stuff into a 100kB "Prop Welcome Mat" drive image? — Parallax Forums

What could we stuff into a 100kB "Prop Welcome Mat" drive image?

TubularTubular Posts: 4,717
edited 2011-09-01 02:02 in Propeller 1
I've been playing with the big brother of the PIC18F27J53. When plugged into a USB port, these PICs can present their flash memory as a mass storage drive, with about 100kB of space left after code, FAT space etc

The PIC18F27J53 is available in DIP28 amongst other forms, and opens up a couple of interesting possibilities as an assistant for the Prop
* Being able to program the prop by simply right clicking and 'send to' the drive image (no Prop IDE required). A bit of code would then load that binary image into the prop
* Adding peripherals such as real time clock, micropower and 12 bit ADCs to the prop
* The potential to boot a second prop (there are 2 uarts)
* Putting a "Readme.Txt" file on there for assistance
* Putting HTML files with links to all sorts of useful prop stuff
* Maybe an AutoRun(able) EXE that provides terminal services, or an enhanced terminal previously discussed on these forums?

The 100 kB EXE thing has me checking what might fit. BSTC is slightly too big, as is TeraTerm. Could we come up with a really compact front end/terminal? Java? What would be compact enough?
500 x 354 - 160K

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2010-10-20 12:11
    Tubular,

    If I understand what your suggesting, you could do this by running a monitor program on the Prop with a 128 KB EEPROM. You wouldn't need the PIC chip. However, 100 KB really isn't much space to store a lot of useful stuff. It would be much better to use an SD card to store the files.

    I'm puzzled why you went into detail about the PIC chip, and included the block diagram. What was the point of that?

    Dave

    Edit: I re-read your post again. So you are suggesting that the PIC chip could be used to provide peripherals, USB drive mapping and loading functions. There might be a good application for that. I still don't get the usefulness of a "welcome mat" versus just using the IDE.
  • jazzedjazzed Posts: 11,803
    edited 2010-10-20 12:24
    Interesting ....

    So you attach the PIC to the PROP and mail out hundreds of thumb-drive
    Propellers to micro-controller geeks world wide for micro-marketing :)
    I assume the PIC can be used to boot Propeller as I2C EEPROM.

    A nice web-page would be a good launch-point introduction.

    I've often thought about using DVD's for catalog massive mail marketing.
  • TubularTubular Posts: 4,717
    edited 2010-10-20 12:34
    Yep. Consider a board which has a FT232+EEPROM on it, FT232 for loading purposes initially, and serial streaming afterwards. It requires the FTDI driver to be loaded, the Prop Tool or BST to be downloaded, and then there's documentation.

    Now consider spending about the same $3 on the PIC. The advantages as I see it
    * By presenting as a mass storage device, no software is required on the PC. Its just like connecting a USB memory stick. Non threatening... and perhaps AutoRun.Exe could make it even friendlier

    * For loading programs, right clicking and send the binary also would enable experimentation without needing to get to grips with the IDE (as good as the IDE is, but remember we're "advanced" users) , eg to load the Turbulence binary on, etc

    * The feature set of that PIC is quite rich. It can potentially eliminate the EEPROM, while adding USB, RTC, 12 bit ADC, and micropower management. The diagram is there because others may need other functions (8x8 multiply, touch sensing etc)

    Finally the DIP-28 is a low barrier for us to adopt than the FT232 tssop (or qfn)
  • TubularTubular Posts: 4,717
    edited 2010-10-20 12:43
    Steve,

    I was thinking more of booting using the RX and TX pins P30/31 for this, for compatibility with programs that use FDS.

    The peripheral functions (ADC, RTC) could be supported over I2C though.
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2010-10-20 13:19
    Interesting thought for use with the Propeller. It is the same principle used on NXP's MBED module. Compile the program then dump it onto a mass storage drive that it shows up as. Upon reset, the MBED runs the new program. Having this ability for the prop would really open up some opportunities.
  • schillschill Posts: 741
    edited 2010-10-20 13:35
    This discussion reminded me of something I did in the past.

    One low-tech (but not necessarily simple) approach is to have a device with an sd card in it and a switch that controls what the card is attached to. With the switch in one position (I'm thinking low-tech mechanical switch), the card is connected through normal card-reader hardware to the usb connection on the device. In this case, you plug it into the computer and all the computer sees is the sd card as an external drive.

    If you flip the switch to the other position, the usb connector is attached to the prop (normal communications) and the sd card is attached to the prop (to get program using boot loader).

    You write your program and dump it to the sd card. Flip the switch and the prop runs the program.

    Here's what I did before (a simpler situation):

    http://www.pjrc.com/tech/mp3/gallery/page23.html

    This allowed me to switch a hard drive between a usb interface (for loading the drive from the pc) and an mp3 player (for playing what was loaded onto the drive).
  • Dave HeinDave Hein Posts: 6,347
    edited 2010-10-20 13:39
    Is it possible to program the PIC to present an SD card as a USB drive? I think that would open up a lot of possibilities. This would allow a Prop and a PC to share the same SD drive. I could see a lot of applications for that.
  • TubularTubular Posts: 4,717
    edited 2010-10-20 13:47
    Andrew, yes it would certainly open it up, including the possibility to program from most USB host devices (some smartphones that have OTG functionality)..

    Cluso and I have one of these http://www.citysoftware.com.au/Havit's__Not_Just_an_FM_Transmitter__HAV0002.aspx, if that works there is the possibility to transmit an audio stream (Prop>PIC>Havit>FM) for say an audio readout multimeter.
  • TubularTubular Posts: 4,717
    edited 2010-12-12 05:38
    RS had a nice bundle deal on PicKit3's, so I've fixed my PIM module and am moving forward with this project.

    I've posted screenshots and pics over in the blog area.
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2011-08-31 15:40
    Any additional work occur on this project?
  • TubularTubular Posts: 4,717
    edited 2011-08-31 17:48
    WBA,

    The good news is the mass storage aspect seems to work reliably now (Microchips 14th July 2011 build). The bad news is the storage space is now limited to 7.5kB rather than 100kB. I'm guessing this has to do with the available RAM which is 8kB on the PIC18F47J53.

    Hence I was asking about very small terminal programs. Andys Purebasic one at 9kB is a mighty good effort and comes mightly close. If we could stuff a terminal program on there, the prop could do the rest, and this would be a really easy to use system bypassing any user software installation whatsoever.

    7.5kB is not useless - its good for being able to copy configuration text files over, for instance. Or we could have an HTML page with a welcome and links to all the prop goodies. Or both (subject to size constraints). And of course once the USB stuff is enumerated, the CDC class serial comms is there afterwards for serial communications with the prop, plus that micro has 12 bit ADC, 5V inputs, low power consumption and some other goodies that the Prop can make use of. And the chips are available in good old DIP packaging

    Really though I'm not the person to make this happen because i) I really hate programming PICs after being spoilt by the prop, ii) am very focussed on some commercial prop applications right now and iii) don't have sufficient usb and/or pic experience.

    There is example code for composite MSD (mass storage) and CDC (serial comms) class, and really it needs a PIC programmer person to write a PIC program that provides read access over I2C to the PICs memory (is MSD drive space), ADC, and other peripherals. Like what Jazzed did with his keyboard/mouse using a Atmel micro.

    Any takers?
  • Cluso99Cluso99 Posts: 18,069
    edited 2011-08-31 22:26
    Tubular: 7.5kB may just be enough for the prop to boot from an SD card. Just last night I was looing at the size of my minimal boot and recompiled using bst's optimisation and it reduced to about 1500 longs. But the old femto SD driver has I2C included that can be stripped.

    I am wanting to do this with an ATTiny. It is a much nicer pasm than PIC, and closer to the prop. If I have to learn another, it may as well be the AVR. I have an AVR pcb in my new 1"sq prop footprint, just for such an idea ;)
  • TubularTubular Posts: 4,717
    edited 2011-08-31 23:25
    Hi Cluso

    The 7.5kB is for the 'shared drive' with the PC, so you can just right click on a file and "send to" the E: drive which is actually the PIC's internal memory. The PIC itself has 128kB of flash, and the demo .hex for combined mass storage MSD and CDC serial is about 56kB, so plenty of room left for a prop booter over I2C or serial.

    I guess I should investigate a corresponding Atmel part. I like the 12 bit ADC, and DIP package availability of the PIC one.

    I have some Attiny20's in (no usb but relatively cost effective and prop programmable)

    We must catch up some time soon

    cheers
    tubular
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-09-01 02:02
    Only yesterday, I was daydreaming about using an AVR as some form of periferals and then using the spare flash as a/the "EEPROM".

    Now that there are 256KB chips (with 40PDIP) it night be worth the effort. At present the biggest ones, in PDIP, I have are M644s but the principle should hold.

    I have never played with PICs, just because I didn't want to have yet another set of instructions to clutter up my befudded mind.
Sign In or Register to comment.