Re: [Sdcc-user] STM8 assembly syntax highlighting for Code::Blocks IDE

2021-11-03 Thread Vaclav Peroutka
Hi, good to know it, thank you. "Hi all, I thought I would mention here that I have created and published a syntax highlighting lexer for STM8 assembly language and the SDAS/AS assembler for use with the Code::Blocks IDE. https://github.com/basilhussain/codeblocks-as-stm8-asm-lexer Hop

[Sdcc-user] How to compile for more than 64kB ?

2019-12-06 Thread Vaclav Peroutka
Hello, I was thinking about how to make a bigger projects where I can possibly need more than 64kB of memory on Z80 (or other 8-bit architectures as well). There is a memory mapper in the design and one can map 8kB segments to the range of Z80 CPU. Has anybody seen some method how to do it

Re: [Sdcc-user] Adding support for the 6502 processor

2018-10-16 Thread Vaclav Peroutka
>> Last week I got to TurboGrafx-16 game console and currently thinking how to >> program it in C. My idea is to create HuCard with SD CARD and RAM. Simple >> bootloader chooses the game from SD card, loads it into RAM and runs it. > > The HuC is not quite a 6502. cc65 supports it sort of but the

Re: [Sdcc-user] Adding support for the 6502 processor

2018-10-04 Thread Vaclav Peroutka
Just one remark to this. Several years ago I ported SDCC (SVN version 5568) to ST7 and testing looked OK. I had a look and ST7 and 6502 are very similar architectures. Same A,X,Y registers. SP is 16bit for ST7, status bits are different, probably instruction set and boot vectors as well.

Re: [Sdcc-user] Adding support for the 6502 processor

2018-10-03 Thread Vaclav Peroutka
Hi Jonathan, how are your plans to support 6502 in SDCC going ? Last week I got to TurboGrafx-16 game console and currently thinking how to program it in C. My idea is to create HuCard with SD CARD and RAM. Simple bootloader chooses the game from SD card, loads it into RAM and runs it.

Re: [Sdcc-user] A comparison of C compiler targeting the STM8 (updated for SDCC 3.7.0)

2018-02-28 Thread Vaclav Peroutka
Hi Philipp, thank you for updated tables. But it seems that you forgot to update texts ? I can see that SDCC's Dhrystone and Coremark values are the highest but text states that "SDCC only achieves 0.17 DMIPS / MHz" or "IAR with optimization for speed outperforms all others". That does not corresp

[Sdcc-user] stm8 and gdb support in SDCC

2018-01-08 Thread Vaclav Peroutka
Hello, I found following page https://stm8-binutils-gdb.sourceforge.io/ stating that patch for SDCC 3.6.0 is necessary. "SDCC already had a back end for stm8. Unfortunately not so much debugging info although most of the debugging code was already available. However it is still lacking dwarf CFI

Re: [Sdcc-user] Dhrystone "too good"...?

2018-01-07 Thread Vaclav Peroutka
" Those scores are normal for current SDCC. SDCC STM8 integer performance has improved a lot since the 3.6.0 release. SDCC now achieves higher Dhrystone scores than any other compiler for the STM8. Philipp " Dear Philipp, do you plan to update your pages aa http://www.colecovision.eu/stm8

Re: [Sdcc-user] STM8L152C6 can not write to ADC registers

2017-10-12 Thread Vaclav Peroutka
Hello, how does your ASM code look like ? Vaclav -- Původní e-mail -- Od: Timo Fuckner Komu: sdcc-user@lists.sourceforge.net Datum: 12. 10. 2017 14:26:24 Předmět: Re: [Sdcc-user] STM8L152C6 can not write to ADC registers "Ok so I just removed the unnecessary stuff and created

Re: [Sdcc-user] STM8 Dhrystone performance - new record at 0.355 DMIPS / Mhz using SDCC

2016-07-20 Thread Vaclav Peroutka
Hi Philipp, thank you for the good work ! All regression tests are OK ? Vaclav "ST marketing materials put STM8 Dhrystone performance at 0.29 DMIPS / Mhz. However, when actually compiling the Dhrystone benchmark with different C compilers optimizing for speed, the picture is a bit different:

Re: [Sdcc-user] A floating-point type cheaper than float

2016-04-12 Thread Vaclav Peroutka
" I don't think any of us disagree with the convenience thing. But is anyone actually using 16 bit floats for their apps or projects? The biggest problem is the 11 bit precision -- 8 bit MCUs probably calculate using 16 bits of precision and then unpack-pack into the half float format. Right

[Sdcc-user] sdasZ80 and undocumented instructions

2015-09-30 Thread Vaclav Peroutka
Hello all, I got some old Z80 assembler source code and tried to compile it with SDCC's assembler. But I got errors: mumak47.20141226.asm:249(http://mumak47.20141226.asm:249): Error: .org in REL area or directive / mnemonic error mumak47.20141226.asm:262(http://mumak47.20141226.asm:262): Error

Re: [Sdcc-user] ucsim: datasheet inaccuracies in STM8

2013-04-14 Thread Vaclav Peroutka
Hi Valentin, you can try how it works in ucsim. But I probably do not understand well how addw does work in your example. If you use 2's complement and you add and wrap - it automatically does subtraction, doesn't it ? Vaclav -- Původní zpráva -- Od: Valentin Dudouyt Datum: 15.

[Sdcc-user] STM8 (and ST7) ucsim in SVN

2012-12-23 Thread Vaclav Peroutka
Hello all, I commited ucsim ports for STM8 and ST7 architectures. I tried to make them complete as quickly as possible. Therefore I tested just addressing modes on several instructions. Does anybody have an idea how to automatically test the complete instruction set ? If you want to compile ucs

Re: [Sdcc-user] STM8 port - testsuite results

2012-12-18 Thread Vaclav Peroutka
Hello, I do not know what exactly happened with emailer when I was sending previous email, but I wrote following: I quickly did code size tests for STM8. I took template from SDCC wiki and it is attached. I would upload it to Wiki but I do not have rights for it. Anyway, attachment in the last

Re: [Sdcc-user] STM8 port

2012-12-18 Thread Vaclav Peroutka
I quickly did code size tests for STM8. I took template from SDCC wiki and it is atached. I would upload it to Wiki but I do not have rights for it. Vaclav "Over time, and especially recently, it seems people want an STM8 port of sdcc. Vaclav has started such a port, but its incomplete, and, IM

Re: [Sdcc-user] STM8 port

2012-12-14 Thread Vaclav Peroutka
Hi Philip, > Just look at the drop in generated hc08 code size at > http://sdcc.sourceforge.net/mediawiki/index.php/Hc08_code_size. The STM8 > has 5 8-Byte registers, which the new register allocator can easily > handle. An STM8 port should be written for the new allocator, not the > old one. I j

Re: [Sdcc-user] Adding STM8 support to SDCC

2012-12-06 Thread Vaclav Peroutka
On Thu, 6 Dec 2012, Vaclav Peroutka wrote: " Hi Vaclav, > - ucsim - port is (as far as I remember) prepared but untested It's very nice to hear that somebody is extending features of ucsim. I'm going to pick up and continue to work on ucsim, some new things are implemented a

Re: [Sdcc-user] Adding STM8 support to SDCC

2012-12-06 Thread Vaclav Peroutka
Hi Valentin, did you look at my fork ? If yes, have you tried anything with it ? I can give you access to SVN. I am so busy now that I am not able to continue so far. There are three parts: - SDCC itself - I did some experiments to port the code from HC08 - assembler - V5 from Alan Baldwin - ucs

Re: [Sdcc-user] SDCC and PIC18F12220

2012-11-12 Thread Vaclav Peroutka
Hi Dima, can you try --use-non-free parameter for sdcc during compilation ? Is it better now ? Vaclav "Hello! I've just installed latest version of SDCC and want to compile some simplest  possible program like #include  void main() { while (1) { TRISB = 0;

[Sdcc-user] Internal error - Re: PIC16F721 - how to get supported ?

2012-02-29 Thread Vaclav Peroutka
Hello Borut, Raphael, thank you for help. I installed both SDCC and GPUTILS. I found some non-blocking error. I have no time to test it deeper, but I have code below in the main(). It is of course not so valid but even though I don't expect any internal error like that: sdcc -c -mpic14 -p16f7

Re: [Sdcc-user] PIC16F721 - how to get supported ?

2012-02-27 Thread Vaclav Peroutka
Hi Raphael, > > A number of default headers (stdarg.h, stdlib.h, string.h, ...) seem > to be missing. Did configure emit lines such as > Checking for stdarg.h ... not found > in its process? Possibly all headers are (correctly) wrapped by > #ifdef HAVE_STDARG_H > #include > #endif > so there are

Re: [Sdcc-user] PIC16F721 - how to get supported ?

2012-02-27 Thread Vaclav Peroutka
> > > For one project I started to use PIC16F721. I haven't noticed that it is > still not yet supported. > >>> So the first will be to get support into > >>> gputils (maybe Borut can help here? > >> Done. PIC16{L}F72[01] are supported in gputils svn head. > > Great. Unfortunately, the new hea

Re: [Sdcc-user] PIC16F721 - how to get supported ?

2012-02-25 Thread Vaclav Peroutka
> >>> For one project I started to use PIC16F721. I haven't noticed that it is > still not yet supported. > >> So the first will be to get support into > >> gputils (maybe Borut can help here? > > > > Done. PIC16{L}F72[01] are supported in gputils svn head. > > Great. Unfortunately, the new header

[Sdcc-user] PIC16F721 - how to get supported ?

2012-02-21 Thread Vaclav Peroutka
Hello all, this question probably comes to Raphael but maybe somebody else already worked on this issue, too. For one project I started to use PIC16F721. I haven't noticed that it is still not yet supported. How hard will be to get it supported ? Datasheet is here: http://ww1.microchip.com/dow

Re: [Sdcc-user] USB pic18f stack from nutsvolts

2011-11-09 Thread Vaclav Peroutka
Hi, some time before I successfully compiled this stack with SDCC 2.9.x (I don't remember yet) for PIC18F2455. Then I ported the stack to USB CDC and bulk transfers. If you still need it, I will try to look into my archives and send it to you. Vaclav --

Re: [Sdcc-user] Problem defining config values for pic14 enhanced core device

2011-10-24 Thread Vaclav Peroutka
> > So, please do not disable or exclude pic14 enh. support in the forthcoming > > next sdcc release. > > OK -- I was indeed considering to remove "support" for these devices; > now I will just leave it as it is. > Just for me, if the code is backward compatible, it should be no problem to su

Re: [Sdcc-user] Problem defining config values for pic14 enhanced core device

2011-10-20 Thread Vaclav Peroutka
> Pic14enh. devices has two config word at 0x8007 and 0x8008.I tried with the > following ways: First try:unsigned short __at(_CONFIG1) config1Reg = > (_FCMEN_OFF > & _IESO_OFF & _BOREN_ON & _CPD_ON & _CP_ON & _MCLRE_OFF & _PWRTE_ON & > _WDTE_OFF > & _FOSC_HS); Hi Tamas, have you tried unsigne

Re: [Sdcc-user] PIC16f887 unstable RS232

2011-09-11 Thread Vaclav Peroutka
> Původní zpráva > Od: Ruben De Smet > Předmět: [Sdcc-user] PIC16f887 unstable RS232 > Datum: 12.9.2011 05:19:16 > > Hi, > > I've a problem: I'm trying to connect my pic16f887 to my pc over rs232 > (with max232, which worked when

Re: [Sdcc-user] sdcc plug-in for MPLAB X

2011-06-02 Thread Vaclav Peroutka
Does mplab-x already work with pickit2 ? I know that piklab supports debugging with icd2. But icd2 does not support newer families IIRC. And furthermore - I don't have icd2. It is strange that nobody tried to reverseengineer debugging through Pickit2

[Sdcc-user] How to define DSEG length ? ASlink error

2011-01-10 Thread Vaclav Peroutka
Hello all, I tried very simple project with two files for HC08 port. In main.c there is main() which calls func1() from func.c. In func.lst there is following: 56 ; 57 ; ram data

Re: [Sdcc-user] About SDCC AVR

2010-10-12 Thread Vaclav Peroutka
Because GCC port for AVR exists and is supported. Please try google.com. > > But why AVR was abandoned? > It is a polular kind of MCU. > > > On 10/12/10 9:13 AM, Claude Sylvain wrote: > > > >I notice that the avr branch and z80 branch would not b

Re: [Sdcc-user] Modular program for pic16

2010-04-15 Thread Vaclav Peroutka
Hi, you need to have special linker scripts for bootloader, main module, expansion module etc. There are some examples for bootloader and bootloaderless apps in gputils distribution. Vaclav > > Hi! > > I have to write a program, what consists of a bootl

Re: [Sdcc-user] PIC14 hex file generated too small in size

2010-03-24 Thread Vaclav Peroutka
> > > Hi Vishnu, > > > > do you have defined some config ? Look at following line: > > unsigned int __at( 0x2007)  __CONFIG = _CP_OFF & _WDT_OFF & _BODEN_OFF & \ > >         _PWRTE_ON & _MCLRE_OFF & _INTRC_OSC_NOCLKOUT & _CPD_OFF; > > > > This one is for PI

Re: [Sdcc-user] PIC14 hex file generated too small in size

2010-03-24 Thread Vaclav Peroutka
> > for the device (2.4Kb). Im guessing the sdcc generated hex file doesnt cover > the configuration data (which is at 0x2007). > Hi Vishnu, do you have defined some config ? Look at following line: unsigned int __at( 0x2007) __CONFIG = _CP_OFF & _WDT_O

Re: [Sdcc-user] PIC (18F) code generation tips...

2010-02-08 Thread Vaclav Peroutka
Hi Kusti, I changed Alexander Enzmann's stack to support CDC. I am still planning to put it somewhere on the web (maybe some SVN). Anyway, here is the initial version which worked for me during tests. Vaclav > Původní zpráva > Od: Kustaa Nyholm > Předmět: [Sdcc-user]

Re: [Sdcc-user] Difficulty with GPSIM and SDCC

2010-02-02 Thread Vaclav Peroutka
You can try to run MPLab under Wine. Anyway I personally have not tried that. Vaclav > > What Linux alternative to GPSIM does support C source code? > -- The Planet: dedicated and managed hosting, cloud storage, coloca

Re: [Sdcc-user] Difficulty with GPSIM and SDCC

2010-02-02 Thread Vaclav Peroutka
Hi Scott, do you plan to extend SDCC for C-source code simulation ? Or from your point the GPSIM is dead ? Vaclav > > Hi Jason, > > I have not been working on gpsim for the last year and a half... but the > last I knew gpsim's source browser does not su

[Sdcc-user] PIC16 port - fixme for multiplication

2009-12-09 Thread Vaclav Peroutka
Hello all, I am playing with strings in ROM, make an array and return pointer to the string in array. The C code is below. After I compile it, I see in the code that there is FIXME for multiplication (actual SDCC snapshot). Does it affect anything ? The reason is that the "array" code is short

Re: [Sdcc-user] Another compiler glitch: Is 'data' a pre-defined keyword?

2009-11-16 Thread Vaclav Peroutka
> Noticed this when porting code from an AVR platform (using gcc-avr) - it's > not drastically important, as I've just renamed 'data' in my code to > something else which then compiles and works fine, but FYI... > > Thanks, > > Gordon > Yes, it is used for data memory ( and "code" for code m

Re: [Sdcc-user] USB CDC or HID implementation on SDCC

2009-11-12 Thread Vaclav Peroutka
> > Hi guys, I'm playing with SDCC for a while, always using RS232 for debug > and communication, recently replaced my workstation for a notebook and > no more serial ports available, so I decided to just abandon the RS232 > and go for the USB. > > I've

Re: [Sdcc-user] sdcc and PIC18F2550 ?

2009-11-01 Thread Vaclav Peroutka
> Hi, > > As my current project is slowly growing bigger than the memory in my > PIC16F886, I'm considering moving it onto a PIC18F2550. > > Does anybody here have good or bad feedback using the PIC18F2550 with sdcc ? > > I see from its datasheet that it has a richest instructions set than the

Re: [Sdcc-user] sdcc 4kBytes code limit ?

2009-10-14 Thread Vaclav Peroutka
Hi Michel, > It however looks suboptimal to me to have to manually split the project into > several source files and try to balance "code weight" between them. IMHO it is better to do that manually. Compiler would that that as well by analysis of the function call tree. But SDCC is not such cle

Re: [Sdcc-user] sdcc 4kBytes code limit ?

2009-10-14 Thread Vaclav Peroutka
Hi Michel, > myprog.asm:11063: message : Crossing page boundary -- ensure page bits are > set. this is just page limit. Thus, inside single file you don't need to switch between pages. You should move some functions into the second source file and page bits will be set automagically. Best reg

Re: [Sdcc-user] configuring microchips in the really high memory spaces

2009-09-07 Thread Vaclav Peroutka
Hi William, I regularly use following: WORD at 0x2007 __CONFIG = _CP_OFF & _WDT_OFF & _BODEN_ON & \ _PWRTE_ON & _HS_OSC & _CPD_OFF; for PIC12F and PIC16F lines, and following: code char at 0x30 CONFIG1L = 0x24; // USB, /2 post (48MHz), /5 pre (20 MHz) for PIC18F line. Best Regards,

[Sdcc-user] PIC16 port - how to create array of more than 256 bytes ?

2009-09-04 Thread Vaclav Peroutka
Hello all (especially Raphael), Have anybody tried with success to create a byte array bigger than 256 bytes ? I need it for SD/MMC communication and for LAN packets as well. I have a lot of space in 2kB of SRAM (I use PIC18F2550). But sdcc does not allow me to declare bigger buffer. Thank you

[Sdcc-user] Is 16-bit floating point library available ?

2009-05-14 Thread Vaclav Peroutka
Hello all, my question is maybe slight off-topic, but, did anybody have implemented half-precision floating point library for PIC16F processors ? I'd like to implement fast Goertzel DFT algorithm over the data from 12-bit ADC and 32-bit seems to me overkill. Or does anybody have a better idea

[Sdcc-user] PIC14 - how to optimize code ?

2009-03-09 Thread Vaclav Peroutka
Hello all, I have one application - some special type of headlamp driven by PIC12F675. The problem is that I can not fit into the memory. I get following from ASM code: ; code size estimation: ; 794+ 74 = 868 instructions ( 1884 byte) It means that I should have around 150 word

Re: [Sdcc-user] Pic14 port - maybe bug in INT addition ?

2009-02-25 Thread Vaclav Peroutka
> The second BTFSC checks the ZERO flag, which is set iff > `gYrotation[1]+CARRY == 0'. In this case, the high byte of gYfilter in > fact does not require any change. Ehh, you are right. I forgot that MOVF sets 'Z' flag. > Do you observe erroneous behaviour exactly when this code fragment is

[Sdcc-user] Pic14 port - maybe bug in INT addition ?

2009-02-20 Thread Vaclav Peroutka
Hello, I am fighting with 16f690 processor. I have two INT variables and add them together. SDCC generates following code: ; .line 349; "main.c" gYfilter = gYfilter + gYrotation; BANKSEL _gYrotation MOVF_gYrotation,W BANKSEL _gYfilter ADDWF _gYfilte

[Sdcc-user] PIC14 problem - no target memory

2009-02-14 Thread Vaclav Peroutka
Hello all, I needed to add some code to project written for SDCC. But it looks I am out of memory. I have 2 modules. After compilation, the length is 1940 instructions for main.asm and 411 instructions for func.asm The problem is that I get >>error: no target memory available for section "code

Re: [Sdcc-user] I2C with PIC 16f877 and 32Kbit 24AA32A EEPROM

2009-02-12 Thread Vaclav Peroutka
Nestor, you cant' have output in '1' on I2C bus. The principle is to have output in '0', pull-ups on the bus and when you want to set '1', just just switch TRIS to '1'. And that's all. Example routine for I2C START for 12F675 follows: // I2C definitions #define SCL TRISIO2 #define SDA

[Sdcc-user] Initiation of 68HC05 / ST7 port of SDCC - questions

2009-02-06 Thread Vaclav Peroutka
Hello all (and especially Erik), this is probably not the right list but, I'd like to start to port SDCC to other architecture. I chosen HC05 (especially its extension ST7). I got the src/hc08 directory and started to change files. I have one question ( I am sure that other questions will arise

Re: [Sdcc-user] Sound light with 16f628

2009-02-05 Thread Vaclav Peroutka
> What's about this? > > http://www.josepino.com/pic_projects/?sound_meter > > > Thanks in advance for your ideas. > > v. > Vittore, on that page you have the description how to measure the value. You can even disassemble the HEX file given there. Isn't it enough ? --

Re: [Sdcc-user] Sound light with 16f628

2009-02-05 Thread Vaclav Peroutka
> > I known C, and I have already wrote code in C and C++, > I know how to read/write pin (so on/off) led. > My problem is how to read analog value from this pic 16f628 with sdcc. > > Thanks in advance. > > v. You've probably chosen wrong processor. AFAI

Re: [Sdcc-user] Sound light with 16f628

2009-02-05 Thread Vaclav Peroutka
> > Hi to everyone, > > I wanna switch from mplab to piklab with sdcc. So I need some help > about my first coding: > > This is the circuit: > http://i40.tinypic.com/34xj994.gif > > Action that I want into the code: > Led green: on (pin 11) > When sound r

[Sdcc-user] sdcc -mpic16: how to reduce code ?

2009-02-02 Thread Vaclav Peroutka
Hello all, I am working on PCB tester with programming capabilities for PIC - of course in SDCC. I compile target.c, generated HEX is then processed into .H file and linked together with code of the main application. Target code is really simple, but it seems to me that overhead is quite big. I

Re: [Sdcc-user] Musings re: porting lwIP stack to PIC

2009-01-30 Thread Vaclav Peroutka
> > Hi, > > I'm not seriously contemplating porting lwIP stack to PIC, > but out of curiosity I did some experiments. > In about two hours I was able to get it to compile with SDCC. > > Hi Kusti, What was the rough memory size of the compiled stack ( F

Re: [Sdcc-user] TCP/IP support for PIC18 - alledged SDCC shortcomings re PIC18

2009-01-28 Thread Vaclav Peroutka
Hi Peter, > I agree with you in part on this, but it is useful to have a clear answer > about the state of the compiler you're working with so you know what you can > expect. Its open source so it doesnt need to be sold, and i'm happier to > help improve it if I know what its like, rather than as

[Sdcc-user] PIC14 (and probably PIC16 as well) bug: generated HEX has wrong name

2009-01-11 Thread Vaclav Peroutka
Hello all, I noticed, that when I use some longer name with more dots, I get HEX name till the first dot. For example, I have main.simpleloop.c - after compilation I get just main.hex. ASM, LST etc are created correctly: sdcc -V -mpic14 -p16f690 main.simpleloop.c message: using default linker s

Re: [Sdcc-user] Slightly OT - PIC18 PORTD bit 2 not working for me

2009-01-11 Thread Vaclav Peroutka
Hi Kusti, are you sure that you have proper connection of wires to that pin ? And pin is not shorted to anything else? AFAIK PORTD2 bit has no other functionality to 1 and 0 bits. If you remove anything else and make simplest code ( just Z = 0, delay(); Z= 1; delay() )- it does not work, too ?

[Sdcc-user] PIC14 - missing banksel for local variables ?

2008-12-26 Thread Vaclav Peroutka
Hello, I am trying software I2C routines in SDCC for PIC16F676. Currently with no success. So I played with bit-bang output and found some interesting feature (honestly, I do not know if it is a bug or feature). Tha main problem is that when I set TRISA0 = 1; RA0 = 0; TRISA0 = 0 -> there is "

[Sdcc-user] HC08 port: ST7 support

2008-12-18 Thread Vaclav Peroutka
Hello all, in the post below, I found that some people use as-hc08 from SDCC to assemble files for ST7 processors: http://www.stm32circle.com/forum/viewtopic.php?pid=1253#p1253 Has anybody tried to make a simple C program and compile it for ST7 ? How big effort will be to make SDCC port for ST

[Sdcc-user] PIC14 port - pic12f675.h TRISIO_bits missing + macro expansion

2008-12-15 Thread Vaclav Peroutka
Hello, I started to play with software I2C on 12F675 and found that TRISIO_bits definition is missing. Can somebody add following (or something similar) into pic12f675.h (and corresponding "volatile __TRISIO_bits_t .." line into .C file) ? // - TRISIO bits typedef unio

Re: [Sdcc-user] Question about PIC18F4550

2008-12-15 Thread Vaclav Peroutka
> > Um, no. SDCC comes with a libc and a bunch of ADC/I2C/USART routines, but > nothing as fancy as USB. However, several (i.e., at least two) USB stacks > are available for SDCC (I remember one from nuts and volts magazine, but > that one nowadays needs some syntacic massaging to run). Mayb

[Sdcc-user] PIC16: How to generate COFF file ?

2008-12-10 Thread Vaclav Peroutka
Hello, how do I generate COFF file ? If I use "sdcc --debug -V --calltree -mpic16 -p18f2580 main.c" I will get just ADB. Thank you, Vaclav -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. Th

Re: [Sdcc-user] [ pic18f, simple program, no crt ]

2008-11-25 Thread Vaclav Peroutka
If it did not help, you have problem somewhere else. Check following: - correct voltage on PIC - if LED is correctly polarized - do you use blocking capacitor on PIC's power pins ? - do you have oscilaltor correctly set (try internal OSC) About month ago I had problem with unstable UART. It was be

Re: [Sdcc-user] SDCC -mpic14 and TRISB_bits do not work ?

2008-11-20 Thread Vaclav Peroutka
> > > TRISB_bits.TRISB6 = 0; // SCK > Hello, I just found that direct TRISB6 = 0; works properly. Even if I would like TRISBbits.TRISB6 = 0; as it is done for PIC16 port. Is there any plans to synchronize it ? I have another question. In SDCC manua

[Sdcc-user] SDCC -mpic14 and TRISB_bits do not work ?

2008-11-20 Thread Vaclav Peroutka
Hello, I use following short code: #include void main(void) { // config the application OSCCON = 0x70; //8MHz internal clock, sysclock defined in CONFIG ANSEL = 0x00; ANSELH = 0x00; // config SPI TRISB_bits.TRISB6 = 0; // SCK TRISB_bits.TRISB4 = 1; // SDI TRISC_bits.TRISC7 = 0;

Re: [Sdcc-user] PIC16 and proper use of printf()

2008-11-03 Thread Vaclav Peroutka
-- > Hi, > > Seems very similair to a problem i had recently with an 18f4520. > As someone on this mailinglist pointed out, the extended instruction set had > to be disabled. > To do this add _XINST_OFF_4L to the __CONFIG4L initialisation. > &

Re: [Sdcc-user] PIC16 and proper use of printf()

2008-10-30 Thread Vaclav Peroutka
to the __CONFIG4L initialisation. > > Regards, > -Bastiaan > > On Thursday 30 October 2008 09:35:36 Vaclav Peroutka wrote: > > Hello all, > > > > yesterday I experimented with printf() on PIC18F2580. I included stdio.h, I > > defined void PUTCHAR(char c) a

[Sdcc-user] PIC16 and proper use of printf()

2008-10-30 Thread Vaclav Peroutka
Hello all, yesterday I experimented with printf() on PIC18F2580. I included stdio.h, I defined void PUTCHAR(char c) and I set stdout=STREAM_USER. PIC sent some proper string just during the programming. But after I switched normal supply, I got nothing on UART. But program run ok (flashing LED

Re: [Sdcc-user] SPI problem on PIC18F2580 - looks SOLVED

2008-10-20 Thread Vaclav Peroutka
Hello all, after some elaboration I found the proper solution. Or, at least, it can currently work for me. I apologize for my stupid questions and as a reward I am sending current working SPI_test.c to all people interested. There are some couple of things which can be done better. For example

Re: [Sdcc-user] SPI problem on PIC18F2580

2008-10-20 Thread Vaclav Peroutka
Hi Raphael, > Before we dig any deeper: did you disable the extended instruction set using > something like > __code char __at(__CONFIG4L) conf4l = _XINST_OFF_4L; > I have following config: __code char __at(__CONFIG1H) conf1h = 0x08; // Select HS OSC __code char __at(__CONFIG2L) conf2l = 0x00;

Re: [Sdcc-user] SPI problem on PIC18F2580

2008-10-20 Thread Vaclav Peroutka
Hi Raphael, > Before we dig any deeper: did you disable the extended instruction set using > something like > __code char __at(__CONFIG4L) conf4l = _XINST_OFF_4L; > I have following config: __code char __at(__CONFIG1H) conf1h = 0x08; // Select HS OSC __code char __at(__CONFIG2L) conf2l = 0x00;

[Sdcc-user] SPI problem on PIC18F2580

2008-10-20 Thread Vaclav Peroutka
Hello all, I already wrote to Microchip forum but the problem can be in SDCC as well. The problem is that when I use "built-in SPI" read, I always get 0x00. But with "manual SPI" I get correct result. I started to fight with the communication between PIC18f2580 and CC1100 in SDCC version 2008-

Re: [Sdcc-user] PIC18f4520; passing array to a function doesn't work

2008-10-14 Thread Vaclav Peroutka
Hi Bastian, did you compare generated ASM code for 452 and 4520 ? Are there some differences ? V. > Hi, > > Little follow-up on my own post. > Tried the same code on the 18f452 (with some small changes to the config to > make it run). Thistime using SDCC 2.7.0, as the 2.8 snapshot i was using

Re: [Sdcc-user] USB compilation for PIC16 - strange errors - the story continues

2008-09-11 Thread Vaclav Peroutka
> > > Hmm. I spent the evening (after your post) compiling and inspecting the > > USB/PICHID/* stuff and updated the source to compile without warnings > > "the right way" (except for EVELYN, which is harmless: it removed empty > > if-blocks). Find attached a more generally applicable Makefile,

Re: [Sdcc-user] USB compilation for PIC16 - strange errors

2008-09-10 Thread Vaclav Peroutka
Hi Raphael, > Hmm. I spent the evening (after your post) compiling and inspecting the > USB/PICHID/* stuff and updated the source to compile without warnings > "the right way" (except for EVELYN, which is harmless: it removed empty > if-blocks). Find attached a more generally applicable Makefil

Re: [Sdcc-user] USB compilation for PIC16 - strange errors

2008-09-05 Thread Vaclav Peroutka
> Maybe > https://sourceforge.net/tracker/?func=detail&atid=100599&aid=1772322&group_id=599 > > is related to and can solve your problem, though I do not quite why > recompiling the libraries (solution proposed there) did help at all... > You might try using SDCC 2.5.6 (r4161, to be obtained fr

Re: [Sdcc-user] USB compilation for PIC16 - strange errors

2008-09-04 Thread Vaclav Peroutka
> The above measures will allow you to build the project, but manual > inspection of the code generated for usb.c, l.309 revealed that there is > severe bug in the code generator: instead of just reading > SetupPacket.wValue1 (offset 3), the generated code overwrites > SetupPacket.bmRequestType (of

Re: [Sdcc-user] PIC16 - how to manually create library ?

2007-12-06 Thread Vaclav Peroutka
> > > > > > How can I manually create (on Win32 platform) pic18f2455.lib file ? I > > > downloaded sdcc-2.7.0.tar.bz2 source package and there is just Linux > > > (./configure;make;make install) methodology described. > > > > > > If I try it with just "sdcc pic18f2455.c" - it does not work for me.

Re: [Sdcc-user] PIC16 - how to manually create library ?

2007-12-06 Thread Vaclav Peroutka
Hello, I probably do not have MinSYS properly installed. The log is attached. Is it possible to just run following: sdcc $SOME_SDCC_PARAMS pic18f2455.c gpasm $SOME_GPASM_PARAMS pic18f2455.asm gplib $SOME_GPLIB_PARAMS pic18f2455.o to have just the desired LIB file ? Or it is just not possible ?

[Sdcc-user] PIC16 - how to manually create library ?

2007-12-05 Thread Vaclav Peroutka
Hello, > Try with these updates, compiles with SDCC 2.7.0 #4818. > > Note that you must recompile the SDCC library files using the 2455 (or > 4550, ...) as the default processor. If you use the ones that come > with the SDCC distribution, the resulting code won't work (problem with > sfr allocati

Re: [Sdcc-user] USB library of PIC18 series

2007-12-04 Thread Vaclav Peroutka
Hello, we were just talking about it yesterday. Have a look in the sdcc-user archives. There are some problems with compilation but hopefully Raphael Neider is working on it and will find some solution. Vaclav > Hello, > > I'm new in SDCC. I have use MPLAB's assembler for my PIC18 series. >

Re: [Sdcc-user] USB compilation for PIC16 - strange errors

2007-12-03 Thread Vaclav Peroutka
Hello JA, > I used the nuts&volts code to implement a USB-CDC device. For this i had > add the following lines to a local copy of the 18f2550.lkr file. > > SECTIONNAME=CONFIG ROM=config > SECTIONNAME=bank1 RAM=gpr1 > SECTIONNAME=usbram4RAM=usb4 > SECTIONNAME=usbram5

Re: [Sdcc-user] USB compilation for PIC16 - strange errors

2007-12-03 Thread Vaclav Peroutka
Hi Raphael, thank you very much for your quick response! I corrected the lines as you suggested and it looks much better. I have following output (maybe some problems with gputils) - there is EEPROM memory. I noticed it in some other projects as well so it is not a bug of USB code or SDCC itse

[Sdcc-user] USB compilation for PIC16 - strange errors

2007-12-03 Thread Vaclav Peroutka
Hello all, I tried to compile the USB code from N&V June 2006 ( http://www.nutsvolts.com/media-files/113/USB.zip ) and got following messages: D:\V\USB-test\PICHID>make sdcc -I. -I\include --vc --fstack --denable-peeps --optimize-goto --optimize-cmp --optimize-df --obanksel=9 --opt-code-s ize -

Re: [Sdcc-user] SDCC error: no target memory available for section {...} - PIC18F2320

2007-10-22 Thread Vaclav Peroutka
> > Thank you (Raphael) for having answered my question. > I think something need to be added to my code or compilation command to > reduce compilation code size, because the same program (using float > variables) was compiled in IAR and MikroC and the results were about > 4.8KBytes of code size (

[Sdcc-user] pic-port - how to optimize string manipulation

2007-10-07 Thread Vaclav Peroutka
Hello, I am programming small application for driving GSM phone. I have "const unsigned char" strings (which are compiled as retlw instructions) and SendToGSM( const unsigned char *pString) function which sends the strings. But I noticed there is a big overhead when calling the SendToGSM() and

Re: [Sdcc-user] How to initialize data EEPROM ?

2007-08-27 Thread Vaclav Peroutka
Hi Raphael, > Hi Vaclav, > > > I'd like to move some strings like CONNECT, PASSWORD, USERID etc. > > from code to eeprom to spare memory. How can I statically initialize > > EEPROM ? I tried something like: > > > > unsigned char at 0x2100 EEPROM_CONNECT[] = "CONNECT"; > > > > but SDCC does not

[Sdcc-user] How to initialize data EEPROM ?

2007-08-27 Thread Vaclav Peroutka
Hello, I'd like to move some strings like CONNECT, PASSWORD, USERID etc. from code to eeprom to spare memory. How can I statically initialize EEPROM ? I tried something like: unsigned char at 0x2100 EEPROM_CONNECT[] = "CONNECT"; but SDCC does not recognize that this should be directly stored i

Re: [Sdcc-user] Microchip AN724 compiled by SDCC ?

2007-08-26 Thread Vaclav Peroutka
due to > its architecture (single front-end, p-code to multiple target translation). > > Daniel > > Vaclav Peroutka wrote: > > >Hello, > > > >I tried to compile AN724 ping.c code for simple PPP connection but got into > troubles with code size. In PDF there

[Sdcc-user] Microchip AN724 compiled by SDCC ?

2007-08-24 Thread Vaclav Peroutka
Hello, I tried to compile AN724 ping.c code for simple PPP connection but got into troubles with code size. In PDF there is a note about 2170 words of code. After I ( ...ported it and... ) compiled it I got last code cell 0xd27 - it is 3367words even with "static" functions. It can't fit into s