Inactive Propeller
Vega256
Posts: 197
Hey Guys,
I was testing some of my first drivers that involves input through one of the I/O pins. I applied 3.3V to one of the I/O pins which was acting as an input to emulate a logical one. I tested that driver for quite a while before the Propeller exhibited strange behavior. Not only has it stopped executing that particular driver but the video drivers produce distorted video on the screen. I checked the maximum ratings and the maximum allowed voltage on any other pin with respect to Vdd was -0.3V - (Vdd + 0.3)V.
I seems unlikely, but have I destroyed my Propeller?
I was testing some of my first drivers that involves input through one of the I/O pins. I applied 3.3V to one of the I/O pins which was acting as an input to emulate a logical one. I tested that driver for quite a while before the Propeller exhibited strange behavior. Not only has it stopped executing that particular driver but the video drivers produce distorted video on the screen. I checked the maximum ratings and the maximum allowed voltage on any other pin with respect to Vdd was -0.3V - (Vdd + 0.3)V.
I seems unlikely, but have I destroyed my Propeller?
Comments
My first guess is that you have a bug in your code. Of course the code has full access to HUB RAM, so a bug can cause problems for each other COG that relies on data in HUB RAM. Each SPIN COG can show strange behaviour if the stack is corrupted.
As a beginner you should always add an resistor (say 1k) to each I/O pin that you use - no direct connection to other hardware. This protects the pin from a shortcut caused by a bug.
Starting SPIN COGs with a stack that's to small.
PASM COGs that write to HUB RAM areas that are used by other COGs (for example the video driver)
....
Post your code and we can tell you ...
First comments to this code:
I think it's a bad idea to use pins 16...31 like this, as pins 29 and 28 are used for the EEPROM. Pins 30 and 31 are used for prop to PC connection during boot of the propeller.
The indentation of
address++
seems to be wrong. It's "inside" the if and will never be executed.
Once the initialization routine loads a program from either the PC or an EEPROM, these special I/O pins are no longer needed for this use and they can be reinitialized and used for other purposes.
I was only questioning this comment. Why is it a bad idea to use these pins if the communication between the Prop and EEPROM ends before the program uses them?
So, tell me ... what do you do to make sure that the signals you send on pins 28 & 29 do not look like a EEPROM-read instruction? Or even worse an EEPROM-write instruction? The best case is that you recognize those kind of problems immediately. Worst case is that your project is compleded and after months you have one occurrence of a write EEPROM and you will never figure out what happened ;o)
You should spend some $, € or whatever currency that's used in your country to buy a propeller plug or any other USB 2 serial converter. Your current programming cycle is wasting a lot of time and sending debug-information to the PC is so easy and helpful.
What do you expect from the first code you posted in the [ code ] - segement? As I said ... if this is really what you have in the propeller tool, the position (intendation) of address ++ avoids it from outputting anything else than 0 on the address-lines.
Do you run your propeller with a chrystal or with the internal clock?
After realizing the issue with the TX/RX and EEPROM pins, I devised a solution. I will multiplex some pins so that pins 28-31 can be left alone. I did find the bug in my code. Thank you; I must have tabbed that line over by mistake and the indentation format of SPIN/ASM does not help. I come from C/C++. I use a crystal, by the way.
It helps a lot with indentation..
I also second the suggestion to have a serial connection with your PC. This way you can program the RAM, speeding thing a lot things, and you can use the terminal for debugging. The prop plug is the easiest solution, but not the only one.
Massimo