Shop OBEX P1 Docs P2 Docs Learn Events
Slave Coprocessor for BS2e? — Parallax Forums

Slave Coprocessor for BS2e?

SandgroperSandgroper Posts: 62
edited 2008-01-23 11:25 in BASIC Stamp
Hi all,

Can anyone help with some·code for setting up a PIC 16F84-A as a slave coprocessor to a BS2-e chip?

I'm using PBasic 2.5 with the BS2-e.· I have a reasonable understanding of PBasic, including the SERIN and SEROUT commands, but only a very basic understanding of "bit banging" and asynchronous serial communication.·

I'm using a Velleman P8048 programming board for the PIC chip and·MPLAB IDE·as the editor.· I don't have PIC BASIC software, so I'm using the language and syntax specified in the manufacturer's datasheet.· I realise it would be easier to use a BS2 as a coprocessor but I'm limited to the footprint of the 16F84A.· The existing socket is already connected to the BS2-e.· The 16F84A is the only coprocessor attached.

On the PIC, pin 3 (RA4) is connected to P8 (pin 13, network pin) on the stamp, pin 4 (MCLR) is connected to pin 22 (Reset), pin 5 (Vss) is·connected to ground, pin 14 (Vdd)·to pin 21 (+ 5 v), and pins 15 (OSC2) and 16 (OSC1)·to a 4 Mhz XTAL·circuit.· I've jumpered the PIC socket to a breadboard for testing purposes, pin for pin.··RA0 to RA3 and RB1 to RB7 are open for use.· The power supply is approx. 10.8 V DC with a regulated 5v·to Vdd.· The relevant protection resistors etc are in place.· I'd·include the schematic but it is copyrighted.

My initial target is simply to set up a programme that returns an "acknowledged" character to the PBasic debug screen when it lights up a led attached to RA0.· I should be able to decipher the rest from there.

I already have some sample code written for a BS2 with a PIC16F84, but I don't have the knowledge (yet) for translating this to·a BS2-e with a PIC 16F84A.

Any help would be greatly appreciated!

·confused.gifeyes.gif

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-01-21 16:36
    The bs2 and bs2e code should be the same and I have no idea about the pic that's your side of the project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-01-21 16:39
    The BS2 and BS2e use different "tick-value" constants. This affects keywords like "PULSOUT", "PULSIN", "SEROUT", "SERIN".

    So you SHOULD be able to use the BS2 program, IF you adjust the baud-mode constants.

    Edit: Oops, apparently what I said is not true -- see the following post.

    Post Edited (allanlane5) : 1/21/2008 9:04:05 PM GMT
  • Tracy AllenTracy Allen Posts: 6,667
    edited 2008-01-21 19:35
    The BS2 and BS2e are identical in their timing and serial parameters. No changes should be required.

    Since you're already familiar with the Stamp, take a look at the PIC Source Book by guru Scott Edwards.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • SandgroperSandgroper Posts: 62
    edited 2008-01-23 11:25
    Thanks for all the tips guys!· I'll check out the links and do a bit more reading.
Sign In or Register to comment.