Serial 8 Data Bits

Which one is a 'one time' way to do this?

We've read about synchronous and asynchronous many times.

Still a little unclear about which one works like this:

Set up say a PIC MSSP module. Set up or configure.

Then you pulse it one time and it sends 8 bits.

Probably we are looking for the serial way not the parallel way.

Have a nice day

Bob

@11 AM Friday morning
 
Here is a screenshot of 16F872 MSSP then SPI section.

25524

See a warning sign for us there.

It talks about clock.

We are probably looking for kind that you pulse one time and then it sends the 8 bits serially.

Have a nice day

Bob

@11:30 AM Friday California time
 

oracacle

Senior Member
SPI is aerial peripheral peripheral interface, iirc can be setup for synchronous.
Having a bit more information on what you are trying to achieve would be helpful.

Generally speaking all serial communications needs some kind of clock (there are exceptions). This is why it's important to have as much info as possible, first it need one wire, two or three? What bit rate? Isle high or idle low? It maybe a car of bit banging a solution, or a standard serial command within the picaxe ecosystem maybe a solution.
 
Thank you oracacle

All we want to do is send out bits to one of these boards we have to light up 8 LED's on another board connected to it.

Use a module on a PIC successfully. That is the goal.

Here is type of board.

25525

We have this board and a bunch of others.Some of them have pins marked SCO and whatnot like PIC pins.

Looking for simple way to send serial stream (8 bits, a register) to light up 8 LED to show it is working right.

NO NEED FOR CODE SAMPLES AT THIS TIME

Just trying to lay out a plan at this point.

Have a nice day

Bob

12:00 @noon Friday California
 
Hi

Sorted this out. It came back to us where we left off with this.

The parellel slave port module.Yes.We know it is not serial.

Here is screenshot of datasheet section.

25526

Looks like we just jumper whole port over to 8 LED's.Then start coding.

That will do us for now.

Have a nice day

Bob

1:10 Pacific time
 

AllyCat

Senior Member
Hi,

The physical interface will normally need (at least) two pins, for Data and Clock pulses, but there are numerous software methods that might be used to transmit the bits, partly dependent on the specific hardware (PICaxe type, etc.).

Yes, you can use the SPI hardware directly with specific commands on the X2 chips, or PEEK/POKESFR commands with the M2 chips. That will limit you to only the dedicated pins and you need to find the exact configuration commands to achieve the required polarity and timing of the clock waveform, etc..

Alternatively you can just "bit bang" any combination of available pins on any PICaxe chips, in a subroutine using HIGH / LOW , etc. commands. Again there are numerous methods (for the software) to "read through" the 8 bits of a byte, for example the BITx variables, or shifting the byte with the (X2's) << or >> commands or simply *2 (left shift) or /2 (right shift) commands.

Update: Why are you (now) bothering to look at Port.Pin type commands in the PIC data sheet and not the equivalent PICaxe "pins" variables commands?

Cheers, Alan.
 
Hi Alan

We will be using the JWEC assembler of the PICAXE editor. Edit: WJEC not JWEC.

If anything chokes we will move over to regular assembler.

'for Data and Clock pulses '

That has been sort of throwing us. We hear 'clocking' and we think there is a steady stream running all the time.

We would like to do one time. We think of that as 'pulsing'.

Guess it could be called a 'clock pulse'.

Have a nice day

Bob

@1:30 pm California
 
Last edited:

AllyCat

Senior Member
Hi,
We will be using the JWEC assembler of the PICAXE editor. Edit: WJEC not JWEC.
If anything chokes we will move over to regular assembler.
'for Data and Clock pulses ' ........
Because that's (usually) the names of the interface pins. ;) Functionally, they might better be called Strobe pulses.

But why are you bothering with Assembler (of any "flavour") and PIC data sheets, etc.? Is this for some "educational" purpose? The whole point about PICaxe Basic (i.e. the language) and its User Manuals is that it's possible to write all this sort of stuff in a few minutes and a few lines of program code.

Cheers, Alan.
 
Thank you Alan

'educational" purpose '

Educate ourselves we suppose.

Been plunking along with assembler with the classic PIC's for quite awhile.

16F84 16F872 16F877.Some others.

We saw the 'header' for WJEC assembler.

Looks like the one PICbasic uses. Same idea.

We plan to move up to C and Basic eventually.

Have a nice day

Bob

@3 pm California
 

hippy

Ex-Staff (retired)
The PICAXE chips are designed to run PICAXE Basic programs. They do not support native assembler nor C programming.

The WJEC Assembler converts the 'assembler code' to Basic behind the scenes and downloads that to the chip. WJEC assembler programs will run very slowly compared to a native assembler program. It is purely intended to allow students to get a feel for assembly language programming as part of an educational course rather than deliver a native assembler-level experience. We would not recommend using WJEC Assembler other than for that. It is also only supported for the PICAXE-18M2.

The PICAXE firmware, the Basic interpreter, means that not all on-chip peripherals of a PIC chip are available for use on a PICAXE. This includes the Parallel Slave Port.

The best way to transfer 8-bits of data between one PICAXE and another would be to use SEROUT and SERIN, or HSEROUT and HSERIN.
 

oracacle

Senior Member
I would suggest that if you are going to read an entire port to set the port as an input and read the entire thing to a variable within picaxe basic.
Code:
init:
    let dirsb = %00000000        ;set port b to all inputs
    
main:
    let b0 = pinsb            ;read port b into variable b0
    pause 500                ;pause here for a moment to allow reading
    ;;you can send the reading to terminal if you want
    goto main
This is about as easy as it gets, set the port to an input, then read it whenever you need to. There is no looking through data sheetsm it just works.

the whole reason for having higher level languages is to make life easier. The entire idea of picaxe is to make things easy and remove the very steep learning curve of raw coding which is often a barrier to people.
I started here, on picaxe, and have moved to C and using teensy for a various reasons, cheif of which was speed.

I did have a bit of a look at the data sheet for the 74hc595, it seems to follow a fairly standard SPI protocol. There also seems to be a fair amount if descussions on the forum about it.
 
Thank you Hippy and oracacle

'WJEC Assembler '

Looks like they are two ways to implement it if we understood it correctly.

1 Use an 'as is' 18M PICAXE

2 Use a PIC with the PICAXE assembler template programmed into it.

Will take another look at WJEC tutorial and nail that down.

oracacle

Will respond to your good points.

Right now.Thank you for digging into the 595!

Have a nice day

Bob

@10:30 AM California
 
Hi hippy

Here is the info about using a PIC with WJEC template.

'
All tutorials can be simulated on-screen or downloaded to a real-life PICAXE-18M2 chip on the AXE056 or AXE091 boards (or on a home-made circuit on a breadboard).

If using the AXE056 project board to run a PIC16F88 (programmed via a conventional PIC programmer) instead of using the simpler PICAXE-18M2 system, please use this assembler template.'

That is a 'in the know' PIC. It was the top 18 pin PIC of the classics.

Somebody at PICAXE really knows there stuff.

We will take a look at that 056 PICAXE board.Sort of remember it is an 18 pin socket only board.

Have a nice day

Bob

@11:30 am California Saturday
 

hippy

Ex-Staff (retired)
'WJEC Assembler '

Looks like they are two ways to implement it if we understood it correctly.

1 Use an 'as is' 18M PICAXE

2 Use a PIC with the PICAXE assembler template programmed into it.
The only way to use the PE6 WJEC Assembler is with the PICAXE-18M2.

With PE5 and by purchasing the BAS800 PIC Programmer it used to be possible to program a limited number of older PICmicro devices using a very constrained subset of PICAXE Basic. Those are legacy and superseded, products. Both are effectively unsupported now.
 

papaof2

Senior Member
"Those are legacy and superseded, products."
But the Picaxe Store might disagree with that about the BAS800:
And there are probably several of us with a fresh copy of PE5 stored on a hard drive, thumb drive or optical media.
Not a path I'm interesting in pursuing - having my muse lead me to another finished book is much more appealing.
 

hippy

Ex-Staff (retired)
"Those are legacy and superseded, products."
But the Picaxe Store might disagree with that about the BAS800:
I would argue that's what the store description is saying; it even mentions "legacy" twice in that brief description. And "superseded" in that PE6 is the latest evolution of the PICAXE Editor which doesn't support BAS800 use.
 
Thank you hippy and papaof2

Our PICAXE project is next. Currently doing some testing.

PICAXE does have Editor 5 for download.

Click on Editor 6 instead of download.Take you to a page with description and option to download version 5 and something called

Logicator for PIC.

Have a good evening

Bob

7 pm California time Monday
 

hippy

Ex-Staff (retired)
PICAXE does have Editor 5 for download.

Click on Editor 6 instead of download.Take you to a page with description and option to download version 5 and something called Logicator for PIC.
That is correct. At the bottom of the PICAXE Editor 6 page, under the "Details" tab, it does state; "PICAXE Editor 6 is a new release that replaces both of these two legacy products: PICAXE Programming Editor 5 and Logicator for PICs".

That however is purely an informative statement, with links to what the legacy products it replaces are. It is not a recommendation to use them.

We recommend using PICAXE Editor 6. We do not recommend using legacy products.
 
Top