Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Armmite H7: Full release & documentation Post ReplyPost New Topic
<< Prev Page of 16 Next >>
Author
Message << Prev Topic | Next Topic >>
KeepIS
Senior Member
Senior Member
Avatar

Joined: 13 October 2014
Location: Australia
Online Status: Offline
Posts: 204
Posted: 25 September 2018 at 2:59pm | IP Logged Quote KeepIS

I was just playing around to make sure I was configuring ports correctly and reading pin assignments correctly. I had a short test program reading the blue user button and driving the 3 user LEDS. I made the mistake of setting option autorun on, there was absolutely no way to break out of the small test program. Had to reflash.


Now after reprogramming the chip, (verify while programming) something has changed.


Option default none
Option explicit 
 
option autorun on

   SETPIN 7,INTH,EXITINT ' user button
   SetPin 137,dout ' Blue LED
   SetPin 75,dout  ' Red LED
   SetPin 46,dout  ' Green LED
   
   Do
      Pin(46) = 1
      Pause 200
      Pin(137) = 1
      Pause 200
      Pin(75) = 1
      Pause 200
      
      Pin(46)= 0
      Pause 200
      Pin(137) = 0
      Pause 200
      Pin(75) = 0
  Loop
   
SUB EXITINT
   Pin(46)= 0
   Pin(137) = 0
   Pin(75) = 0
   END
END SUB



If I enable autorun then the program fails on reset with an error:

SetPin 7,INTH,EXITINT
Error: Cannot find label

However if I type run, it works perfectly? surely I'm doing something stupid, can someone enlighten me (I'm not well) that's my excuse.


__________________
It's all too hard.


Back to Top View KeepIS's Profile Search for other posts by KeepIS
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6128
Posted: 25 September 2018 at 3:33pm | IP Logged Quote Grogster

OPTION AUTORUN ON is normally only run at the command prompt - unless the ARM-mite is different here....

I've just tried your code, and I get the exact same error.

If I RUN the code from the console, I get three pretty LED lights.


__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
KeepIS
Senior Member
Senior Member
Avatar

Joined: 13 October 2014
Location: Australia
Online Status: Offline
Posts: 204
Posted: 25 September 2018 at 3:42pm | IP Logged Quote KeepIS

Having autorun there was my mistake, I forgot to take it out of the listing.

Thanks for trying that - I also tried it on the MM 100 (different pins) and it works as it should. Like I said, it was just a quick play around and I didn't expect this?


__________________
It's all too hard.
Back to Top View KeepIS's Profile Search for other posts by KeepIS
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2673
Posted: 25 September 2018 at 3:46pm | IP Logged Quote TassyJim

From the manual
Quote:
Resetting the chip and options
The chip can be reset to “just-programmed” state by connecting pin 7 to VDD whilst resetting the chip
by grounding the RESET pin.

This should let you recover from a rouge autorun.


I expect that using pin 7 on autorun is confusing the reset code.
To test, you could put a big pause at the start of your program.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6128
Posted: 25 September 2018 at 4:00pm | IP Logged Quote Grogster

5000ms pause generates the same error.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2673
Posted: 25 September 2018 at 4:07pm | IP Logged Quote TassyJim

Try this modified program:
Quote:

OPTION DEFAULT NONE
OPTION EXPLICIT

OPTION AUTORUN ON
SETPIN 7,DIN ' user button
SETPIN 137,DOUT ' Blue LED
SETPIN 75,DOUT ' Red LED
SETPIN 46,DOUT ' Green LED

DO
PIN(46) = 1
PAUSE 200
PIN(137) = 1
PAUSE 200
PIN(75) = 1
PAUSE 200

PIN(46)= 0
PAUSE 200
PIN(137) = 0
PAUSE 200
PIN(75) = 0
IF PIN(7) = 1 THEN EXIT DO
LOOP

PIN(46)= 0
PIN(137) = 0
PIN(75) = 0
END

It uses DIN instead of INTH.
You have to hold your paw on the button long enough because I only test once per cycle.

It does mean you can use pin 7 as an input when using autorun but not as an interrupt.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
KeepIS
Senior Member
Senior Member
Avatar

Joined: 13 October 2014
Location: Australia
Online Status: Offline
Posts: 204
Posted: 25 September 2018 at 4:19pm | IP Logged Quote KeepIS

I tried it like that initially, BTW "option autorun on" should not be in the listing, that was a mistake by me when posting.

Changing from pin 7 to another pin makes no difference. Exactly the same error.

I also just had a total lock-up, MM.edit was transferring the small file when it lost the connection, after that it would fail to do any transfer of a program and totally loose the connection, managed to catch an error about failing to erase. After that nothing I could do would allow MM.Edit to connect - full reboot of the PC and all.

So I tried typing NEW in Tera Term and it bought up an error "failed to erase flash memory"

Had to reprogram the dam chip to get it to work again - something strange going on here?



__________________
It's all too hard.
Back to Top View KeepIS's Profile Search for other posts by KeepIS
 
KeepIS
Senior Member
Senior Member
Avatar

Joined: 13 October 2014
Location: Australia
Online Status: Offline
Posts: 204
Posted: 25 September 2018 at 4:27pm | IP Logged Quote KeepIS

Could someone load ST-LINK and do a target file compare with memory, there is a block in red that is different, all 0 instead of F, BTW I did a full chip erase before re loading the Hex file. Perhaps it's normal but I would like to be sure.

__________________
It's all too hard.
Back to Top View KeepIS's Profile Search for other posts by KeepIS
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2673
Posted: 25 September 2018 at 4:42pm | IP Logged Quote TassyJim

Quote:
16:38:41 : [Armmite1.3.hex] opened successfully.
Address Ranges [0x08000000 0x08000298] [0x080002A0 0x080A60C4]
16:38:41 : [Armmite1.3.hex] checksum : 0x026008FE
16:39:18 : 1st difference found @: 0x08020000
All the different data blocks are red colored.

There is the one block as you describe so I wouldn't worry about that.

How are you powering it? I have external power.

Jim

__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6128
Posted: 25 September 2018 at 4:47pm | IP Logged Quote Grogster

Jim - your code works.

Only problem is, that now CTRL-C won't stop it, and reset just autoruns the code again, and now there is no way to stop the running code.

I had to hold the USER button and press RESET to get the ARM-mite back again.

With a simple do/loop code and AUTORUN ON, I get the same problem - you can't CTRL-C break the running program, and the only option is a full reset via the USER and RESET buttons - which completely wipes the program in memory, so this is a bit of a problem.

...unless CTRL-C does not work in the ARM-mite?


__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
KeepIS
Senior Member
Senior Member
Avatar

Joined: 13 October 2014
Location: Australia
Online Status: Offline
Posts: 204
Posted: 25 September 2018 at 4:56pm | IP Logged Quote KeepIS

Thanks Jim, that is the same as mine, Grogster, that was the initial problem.

BTW just powering it via USB at the moment, heavy duty USB cable and the ports on the PC are high current, above normal spec. I'm going to do more tomorrow, very tired and sore at the moment so just on the laptop in the house for the evening.

__________________
It's all too hard.
Back to Top View KeepIS's Profile Search for other posts by KeepIS
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6128
Posted: 25 September 2018 at 5:00pm | IP Logged Quote Grogster

Yes, you are right - you did mention that at the top of this page. Sorry, my eyes must have skipped over that bit. However, we are both seeing the same problems, so that is a good thing, as it means it is not your board or computer etc.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 


<< Prev Page of 16 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1543 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.15