pokesfr $D3,2 ?

alband

Senior Member
I just tried to run a 28X2 at it's slowest speed using "setfreq k31".

The editor came up with an error that was something along the lines of "setfreq k31" is not supported in this firmware mode. (I don't KNOW my 28X2's but I bought it almost as soon as it came out)

The error message suggested I used "pokesfr $D3,2" instead. So I did :eek:

The PICAXE now doesn't seem to be working; I can't download to it (gives same error as if it weren't connected), the sertxd in the program isn't responding, and I can't find anything on the I2C lines which were included in the code using a scope.

This is the exact code I used with the "pokesfr $D3,2" command. I am using the advanced download circuit (don't know if that helps), latest version of PE (5.2.6), windows XP.
Code:
#Picaxe 28X2
'#Terminal 1200
symbol ENABLE = B.5
symbol MOT_ENABLE = B.4
'SetFreq k31
pokesfr $D3,2


hi2csetup i2cmaster,%00110010,255,i2cbyte
 
init:
		low ENABLE
  		pause 500
  		high ENABLE
  		low  MOT_ENABLE  
  		pause 500
  		hi2cout $0C,($00,$42)
  		pause 500
 
main:  	for b1 = %00000000 to %00000101
		pause 50
		readi2c b1,(b0)
		sertxd (#b0,",")
		next
		readi2c %00001101,(b0)
		sertxd (#b0)
		sertxd (CR,LF)
		goto main
Is there any way I can get my PICAXE back?

Addit: Oh the chip was also running at 3.4v while the chip was downloading, it seemed to work ok in that there was no error message for the download.
 
Last edited:

eclectic

Moderator
I've just downloaded your program into
an otherwise unconnected 28X2 5V

Then tried the View option.

See picture.

Using the Reset and then program instructions
"recovered" the 28X2

e
 

Attachments

BeanieBots

Moderator
As eclectic states, the 'hard reset' method should get you out of it.

Power up, apply reset, start the download, wait for the splash screen, release the reset.

Enhanced or 'normal' download circuit will have no difference.
 

alband

Senior Member
Got it back, thanks loads!

Is there any reason why the command it suggested didn't work?

Now that I've got the chip back I can show you what it said when I used "setfreq k31"
 

Attachments

BeanieBots

Moderator
The error "command not supported in this mode" usually means your options are set for a different PICAXE to the one you are using.

Try setting your options to "28X2" or using the "#PICAXE 28X2" directive.
 

eclectic

Moderator
Got it back, thanks loads!

Is there any reason why the command it suggested didn't work?

Now that I've got the chip back I can show you what it said when I used "setfreq k31"
@David.

1. Look at this thread, especially post #16.
http://www.picaxeforum.co.uk/showthread.php?t=12410&highlight=28x2+k31&page=2

2. The pokesfr $d3,2 command ..

I won't say too much, but try this program
using your 'scope.
You may also find a calculator very useful. ;)
Code:
#picaxe 28x2
#no_table

main:
setfreq m4

pwmout c.1,7, 16
; (125kHz at 4MHz)
pause 5000

setfreq k250
pause 500

pokesfr $D3,2

pause 50

goto main


e
 

hippy

Ex-Staff (retired)
Is there any reason why the command it suggested didn't work?
The command ( PokeSfr $D3,2 ) did work, as you can check by running a program which toggles a LED. The problem is that once running at 31kHz the PICAXE is running so slowly that by the time it gets round to acknowledging a Programming Editor download request, the Programming Editor has given up on waiting for a response which has not arrived.

This can happen with any PICAXE running at 31kHz, whether set using "SetFreq K31" or the Poke/PokeSfr commands. Pressing Reset or a power-cycle brings the PICAXE running at a speed where it will respond in a timely fashion to download requests.
 
Top