Revolution PIC Programmer

radiogareth

Senior Member
I bought one of these back in 2003. It does not compile certain PICAXE codes (Readtemp is a known example) for reasons of code confidentiality. I'm OK with that but I'm wondering if there is an upgrade available to reflect the newer/more modern codes, specifically IRout which I want to use.

Having looked at the pin waveforms from the native picaxe endlessly sending IRoutit "irout 0,1,101" it is going a LOT faster than this following code snippet does, even at 32MHz. (on an 08M2)
setfreq m32
do
high 1
low 1
loop
This manages a square wave with a Mark : Space ratio of 1:3 at 180uSec per cycle. (about 5,555 Hz) Nowhere near the 26uS stream needed for IR>>

So I'll answer my own question probably, IROUT is not supported by the PIC Programmer...... clever how they manage to make it deliver the IR individual pulses at 26uS though, within much slower code.

Comments anyone?
 

nick12ab

Senior Member
26 microseconds is approximately 38KHz. This is the carrier for the signal - the signal itself is actually much slower.

It is certainly possible to bit-bang IR (e.g. Philips RC-5 IR output on PICAXE) and the signal can be modulated onto a carrier by using a separate pin with PWM capability for the carrier and use an AND gate or transistors to combine the data with the PWM, or it might be possible to turn the PWM on and off on a pin instead.

The 3-pin IR receiver demodulates the signal when it is received so the output of that will not show the (relatively) high frequency modulation.
 

radiogareth

Senior Member
I should say that I'm NOT sending any IR code as such, I needs a 'gated' 38KHz drive signal within certain specs. Room for an 8 pin pic, nothing else.

Hmm, well that's a useful tip, use the PWM. A quick 'wizard' does indeed produce 50% duty cycle at 26usec, even at 4 MHz clock too! Guess its using the internal PWM module 'outside' PICAXE basic, but there is only the one in an 08Mx.
Two things I need to try and do now..... (a) count 11 cycles of the 38KHz then stop for 9.3 mSec (b) and provide the INVERSE of the PWM to another output pin.

I think an easier resolution is going to be use a simple listing that will translate to assembler, then edit the pauses it adds to make the code run at the same speed as a picaxe would. I can see a way through....I think.

Just tried it on the REVED pic programmer, PWMout is not supported....
 

nick12ab

Senior Member
(a) count 11 cycles of the 38KHz then stop for 9.3 mSec
Have you tried the pwm command? Is that supported?

(b) and provide the INVERSE of the PWM to another output pin.
I don't think that can be easily done or even done at all without assembler. The PICAXE-08M2 does not support hpwm which would enable you to produce an inverted signal. Is there enough room for a surface mount transistor to invert the signal if you use a surface mount PICAXE?
 

radiogareth

Senior Member
OK, this is close although the burst of PWM is too long, but PWM is not supported by the assembler either :-(
Now my picoscope usb leads has gone U/S so I have to find a spare usb A to b lead.

Code:
setfreq m8
main:
pwm C.4,128,1 ; send 1 pwm bursts out of pin 4
pause 8 ; pause 8 ms
goto main ; loop back to start
Although this would probably work, I would need it in assembler for the end user......

An interesting exercise in learning about picaxe though....thanks :)
 

hippy

Technical Support
Staff member
It might be possible to generate what you want with an 08M2. If you could provide a full spec of what you need it will help, as will an indication of what it is to be used for.

The first step is working out if what a PICAXE can generate will be usable or whether the specification is too stringent for a PICAXE to meet. For example, does it have to be exactly 11 full cycles of 38kHz pulses, can there be more or less, can there be part pulses, does it need to have an exact repeat time of 9586us ?
 

radiogareth

Senior Member
OK, fair comments....

I have been asked to produce an endless sequence of pulses comprising 300uSecs duration made up of 26uSec cycles time with a gap of 9.3mSecs between each cycle.
I need the anti-phase of the square wave (apart from the 9.3 Msec off part) to appear on another pin - this is for anti-phase driving of the emitter.

I doubt the absolute number of pulses or the timing between them is critical within to 5%, it is basically an IR based system that needs these approximate timings to keep it happy.

Ideally I need to be able to turn it into assembler via the REVED programmer. Edit: Interesting, I can't find the Serial PIC programmer listed anymore to see if they say what it will won't do etc.
 
Last edited:

hippy

Technical Support
Staff member
This should do the job with an 08M2 but may need tweaking with a logic analyser to get timing how you desire. It's 11 or 12 pulses of 38kHz with an approximate 9.3ms gap when I examine it.

The pulses are output on Pin 0 and are positive going but can easily be made negative going. Not sure why there needs to be a separate inverse signal 'to drive the emitter' as just one signal can control current through the IR LED to turn it on or off. The output on pin 2 is however an anti-phase 38kHz output.

Code:
#Picaxe 08M2

Low 1
PwmOut 2, 25, 53

PokeSfr $FC, %11000000 ; SFR $39C MDCON
PokeSfr $FD, %10000001 ; SFR $39D MDSRC
PokeSfr $FE, %00100000 ; SFR $39E MDCARL
PokeSfr $FF, %01100100 ; SFR $39F MDCARH

Do
  PulsOut 1, 30
  PauseUs 740
Loop
Use the following to invert polarities -

Code:
PokeSfr $FC, %11010000 ; SFR $39C MDCON
PokeSfr $FD, %10000001 ; SFR $39D MDSRC
PokeSfr $FE, %00100000 ; SFR $39E MDCARL
PokeSfr $FF, %00100100 ; SFR $39F MDCARH
The BAS800 PIC Programmer details are in the store -

http://www.techsupplies.co.uk/bas800

You probably could do what you want but likely easier to write that as bit-banged code in Assembler, or tune HIGH-PAUSE-LOW-PAUSE code converted from Basic. The BAS800 is an educational tool with limited capabilities so it won't convert the above code into Assembler.
 
Last edited:

radiogareth

Senior Member
Thanks Hippy. I will try that tomorrow, been away from pc today:-( Thanks for the link to the programmer too, not least for the capabilities it offers.
 

radiogareth

Senior Member
Morning Hippy, Yes that works nearly as intended, output 2 is the inverse 0 but it runs continuously, ideally I'd need it to be pulsed for the same duration as 0. I don't begin to understand how the code works, (a quick search says Advanced users only!!) but remain amazed by what can be achieved.

I also noticed the pauseUs which is a new one on me - not that I need it for flashing some LEDs on and off.:)

Thanks
 

radiogareth

Senior Member
I'm having trouble getting the .Asm to compile into .hex - it says could not open [pathname] of the file I've just loaded to convert.

OK, saved the loaded file with a new path-name, then it seems to assemble OK and asks me if I want to programme - click yes, then it says file not found!!

Looking in the directory it is not making a hex file either, despite indications that it is.

Aarrggghhh!!
 

WHITEKNUCKLES

New Member
I have been trying to use the convert to assembler function with the programmer attached but get "Error 53" then "compiler path invalid" then "c:\.........\picprog\wstamp16.exe"

Windows8 can not find it either. Help.

Dave
 

radiogareth

Senior Member
I'd hazard a guess that its Windows 8 that's causing you your grief, but have no real idea.

I have tried loading the .asm into MPLAB v8.90 (Feb 2013) (free) and doing a "quickbuild" on it. Trouble is it comes up with three errors and I can't see/don't know why.
Specifically: (_BODEN_ON), (OSCCAL) and (CMCON). Loads of other defines 'not listed' seem to assemble just fine.
(Brown Out Detector, Oscillator Calibration and whatever CMCon is) The first two should just be declarations??

I'm not good enough with MPLAB to write from scratch, too much else going on.

Wondering if REVED PICPROG uses aspects of MPLAB and there is a clash on my machine.....or something.
 

besupreme

New Member
That reminds me of the issues I had trying an assembler program for the 16F1503. I ended up completing and correcting the .inc file for that chip. According to the - still - 'preliminary' data sheet. The part is available for at least a year now. ;)
 

Technical

Technical Support
Staff member
I have tried loading the .asm into MPLAB v8.90 (Feb 2013) (free) and doing a "quickbuild" on it. Trouble is it comes up with three errors and I can't see/don't know why.
Specifically: (_BODEN_ON), (OSCCAL) and (CMCON). Loads of other defines 'not listed' seem to assemble just fine.
(Brown Out Detector, Oscillator Calibration and whatever CMCon is) The first two should just be declarations??
All PIC chips use slightly different names and may have slightly different features to others e.g. CMCON may be renamed CMCON1 on a different chip that has 2 CMCONs.
The only way to know for sure is to open the appropriate MPASM .INC file for that PIC chip (e.g. p16F88.inc) and see the naming structure used. You'll find them in a MPLAB sub folder.

wstamp16 is an old 16 bit exe, and so won't run on modern 64 bit systems. It will be updated in PE6.
 

Technical

Technical Support
Staff member
The BAS800 is a mature retired product that supports older legacy raw PIC chips such as the 629/627/84/88 etc. Programming via BAS800 will not be added to PE6 as it does not support the modern generation of PIC chips that are now in use. PE6 will instead export files for use in other programmers.

For 'C' or 'assembler' programming of raw PC chips we would now recommend something like Microchip's PICKit3. When the BAS800 was first designed in the 1990's there wasn't much choice in low cost programmers, however now the main manufacturer (Microchip) also produces their own (and keeps it up to date with every single new part release) it is more logical to use theirs.
 
Top