I think Cluso99 is leading you up the garden path because if he had read your other posts where you have successfully downloaded Spin programs with the same setup, then he would realize that the CP2102 circuit must work. If you are sure that you can do this with Spin then just make sure that your hardware will work with the 8MHz crystal by taking that Spin program and setting it up for an 8MHz crystal x8.
If the Spin program won't run with this setting then try a lower PLL in case you are having supply problems or you are trying to run without "proper" bypass capacitors on Vdd/Vss. It could be that the Spin program is running simply because it is using the default RCSLOW and not the crystal. Anyway, the main thing is to make sure the Spin program that does run, will run with different configurations. If it passes those tests then it must be your software.
Peter, etc
Some loaders use multiple resets during the download process. The way the prop works, coupled with the way PCs work particularly Windows, can and does, cause loading problems under some circumstances. The transistor reset circuit is designed to work with these peculiarities. I could go on and describe how Windows interacts with the serial comma port but it's not necessary.
I know some have used various circuits instead of the transistor circuit with some success. This does not mean that it will work every time.
IMHO, the transistor reset circuit SHOULD BE CONSIDERED MANDATORY whenever downloading is not working properly. If you get by without it, you are just lucky, because it will bite you sooner or later!
This is why I put the transistor/resistor/capacitor on my tiny boards.
Once the hardware can be expected to work properly, then it's time to move on to check other things.
I was going to give up. But finaly I got gcc code working. Thank you all for your advices. The problem why GCC code did not works was really related with clock and software. I found /opt/parallax/propeller-load folder and some configure files and then I changed PLL and clkfreq constants in .cfg file which I am usining for uploading and after I did it finaly blinks.
I was going to give up. But finaly I got gcc code working. Thank you all for your advices. The problem why GCC code did not works was really related with clock and software. I found /opt/parallax/propeller-load folder and some configure files and then I changed PLL and clkfreq constants in .cfg file which I am usining for uploading and after I did it finaly blinks.
That is awesome that you finally have this working. Nice Job!
Could you please provide more details as to what and where you made your changes?
JonM,
As I think those people who don't buy standalone uC and uses ready for use board with already soldered serial converter, ROM, etc, and xtal oscillator (5MHz as usual) will not face such propblem. And as I think if I soldered 5Mhz xtal instead of 8Mhz one, everything was working nice. But sometimes there is no 5Mhz xtal on hand (and unfortunately there were no such xtals in my near shops at time when i started with soldering).
SimpleIDE installs in your /opt LInux (and maybe Mac) directory such folders:
$ ls /opt/parallax
bin lib propeller-elf share Workspace
include libexec propeller-load spin
propeller-load folder contents configure files for different boards as I see.
So then you see - clkfreq and clkmod values must be changed for your xtal and you final freq. These configure file, as i think must be in same way named directory in Windows too.
Or you can chose RCFAST config file without using PLL.
Okay, I got that, but what did you change? Your activityboard.cfg looks just the one on my Mac but my Activity board has a 5.00M crystal and works just fine.
The reason I am curious is that I have a few Propeller P8X32A MCUs and am considering to replace a FLiP with one as well as work on other projects with these.
JonM,
As I think those people who don't buy standalone uC and uses ready for use board with already soldered serial converter, ROM, etc, and xtal oscillator (5MHz as usual) will not face such propblem. And as I think if I soldered 5Mhz xtal instead of 8Mhz one, everything was working nice. But sometimes there is no 5Mhz xtal on hand (and unfortunately there were no such xtals in my near shops at time when i started with soldering).
~~~
So then you see - clkfreq and clkmod values must be changed for your xtal and you final freq. These configure file, as i think must be in same way named directory in Windows too.
What were your final clock settings? PLL8X for that 8MHz xtal?
I changed clkfreq to 64000000. And clockmode to XTAL1+PLL8X.
So now .cfg looks like:
$ cat /opt/parallax/propeller-load/quickstart.cfg
# quickstart.cfg
clkfreq: 64000000
clkmode: XTAL1+PLL8X
baudrate: 115200
rxpin: 31
txpin: 30
tvpin: 12 # only used if TV_DEBUG is defined
cache-driver: eeprom_cache.dat
cache-size: 8K
cache-param1: 0
cache-param2: 0
eeprom-first: TRUE
And my Makefile:
$ cat Makefile
PROPGCC=/opt/parallax
CC=${PROPGCC}/bin/propeller-elf-gcc
LOAD=${PROPGCC}/bin/propeller-load
CFLAGS=-Os -mlmm -m32bit-doubles -fno-exceptions -std=gnu99
BOARD=QUICKSTART
PORT=/dev/ttyUSB0
.PHONY: all clean load
all: main
clean:
rm main *.o
flash: main
${LOAD} -b ${BOARD} -p ${PORT} -I ${PROPGCC}/propeller-load -r -e -Dreset=dtr $<
One thing I dont get, why it wasn't working when I was trying to upload without selecting any board. Maybe it is necessary to configure rx,tx pins, clock and freq settings when uploading. Or I was doing something wrong.
One thing I dont get, why it wasn't working when I was trying to upload without selecting any board. Maybe it is necessary to configure rx,tx pins, clock and freq settings when uploading. Or I was doing something wrong.
The loader has defaults it uses if you don't select a board type. The defaults assume a 5mhz crystal and an 80mhz clock speed.
The config comes with selecting the board type, notice the file name, and again in the make file. SimpleIDE selects activityboard by default to prevent that.
Edit: (this was in spin) I forgot to init my clock once and it took me 10 minutes to figure out the gibberish on my terminal.
One more thing - Can anyone give me linker script files and makefile for skeleton gcc projects. I am not good at makefiles and linker scripts. I need to compile and link multiple files into one elf file for loading.
Comments
This code works. Then it must be my software.
Some loaders use multiple resets during the download process. The way the prop works, coupled with the way PCs work particularly Windows, can and does, cause loading problems under some circumstances. The transistor reset circuit is designed to work with these peculiarities. I could go on and describe how Windows interacts with the serial comma port but it's not necessary.
I know some have used various circuits instead of the transistor circuit with some success. This does not mean that it will work every time.
IMHO, the transistor reset circuit SHOULD BE CONSIDERED MANDATORY whenever downloading is not working properly. If you get by without it, you are just lucky, because it will bite you sooner or later!
This is why I put the transistor/resistor/capacitor on my tiny boards.
Once the hardware can be expected to work properly, then it's time to move on to check other things.
That is awesome that you finally have this working. Nice Job!
Could you please provide more details as to what and where you made your changes?
As I think those people who don't buy standalone uC and uses ready for use board with already soldered serial converter, ROM, etc, and xtal oscillator (5MHz as usual) will not face such propblem. And as I think if I soldered 5Mhz xtal instead of 8Mhz one, everything was working nice. But sometimes there is no 5Mhz xtal on hand (and unfortunately there were no such xtals in my near shops at time when i started with soldering).
SimpleIDE installs in your /opt LInux (and maybe Mac) directory such folders:
propeller-load folder contents configure files for different boards as I see.
In SimpleIDE (or in Makefile adding -b <BOARD_NAME> parameter) you chooses your board, so it uses one if this configure files for loader.
For example:
So then you see - clkfreq and clkmod values must be changed for your xtal and you final freq. These configure file, as i think must be in same way named directory in Windows too.
Or you can chose RCFAST config file without using PLL.
Maybe it be usefull for someone.
The reason I am curious is that I have a few Propeller P8X32A MCUs and am considering to replace a FLiP with one as well as work on other projects with these.
Thanks.
What were your final clock settings? PLL8X for that 8MHz xtal?
I changed clkfreq to 64000000. And clockmode to XTAL1+PLL8X.
So now .cfg looks like:
And my Makefile:
One thing I dont get, why it wasn't working when I was trying to upload without selecting any board. Maybe it is necessary to configure rx,tx pins, clock and freq settings when uploading. Or I was doing something wrong.
Edit: (this was in spin) I forgot to init my clock once and it took me 10 minutes to figure out the gibberish on my terminal.