Hi Evert,
So program a generic goto, then check each pin as you said, then act.... Is it possible for both to happen at the exact same time? Or just program it so it could, just in case?
Thanks for your reply Evert,
Tim
↧
BASCOM-AVR : How to program for >1 PCINT? : REPLY
↧
BASCOM-AVR : Eram : REPLY
Hello Tubeampman
EEPROM takes longer
Regards Paul
↧
↧
BASCOM-AVR : Eram : REPLY
Hi
Thanx for fast answer :-)
Øyvind
↧
BASCOM-AVR : Question about programming : REPLY
So there is no way i can program it without buying a programmer and uploading the boot loader first?
↧
BASCOM-AVR : Question about programming : REPLY
Yes you have to program it with a boot loader first using a programmer
Programmers are very cheap now.
Regards Paul
↧
↧
BASCOM-AVR : Question about programming : REPLY
How about using this: http://wewannalearn.blogspot.com/2011/11/avr-programmer-how-to-make.html ?
↧
BASCOM-AVR : Question about programming : REPLY
Yes. This is SIProg. I made it with PonyProg years ago and work to this time with Compaq NX9005 without external power supply :D SiProg is supported by AvrDude so for newest chips You can use Burn-O-mat :D But simplest ever programmer is. For paralel port. Four resistors needed. Sometimes people insert it without plug Hahaha directly to port.
[img:2ed7a450b6]http://iv.pl/images/34712781930148428658.png[/img:2ed7a450b6]
↧
BASCOM-AVR : Atmega2560 : REPLY
Hi Toto,
My opinion without any evidence to back it up is that it is a hardware problem rather that software. Transients can really spoil your day.
I say this with a background of using RS485 for networking Fire Indicator Panels and Emergency Warning Panels over a wide variety of installation environments. Everything from Sydney Airport to Parliament House, to power stations and mines with 3+ km runs. The hardware failure and data error rates are very low.
So, the tricks employed are:
1. Use shielded cable. Twisted if you can get it. This adds to the cable capacitance, but helps keep the garbage at bay.
2. Connect all the shields together, but only Earth (or connect to 0V) at one point. Preferably the master.
3. Provide transient protection to the RS485. Series 10R resistors for the D+ and D-, inductive filters MOVs and Transorbs.
4. This one is a contentious one: provide pull up (2K7) / balance (470R) / pull down (2K7) resistors for D+ and D-. Some data sheets say only provide these on the ends of runs, but I have seen this arrangement run over 2 km with 35 devices.
5. Make sure the power supply to the board is clean. I use a bifilar would toroid. This stops everything. Put the processor board next to a fluoro desk lamp and turn the lamp off and on a few times. If the board resets, filter the supply.
Don't try to save a few bucks by skipping this stuff. The cost of not doing it is ongoing pain as well as dollars.
Just my 2c.
Cheers,
Tony
↧
BASCOM-AVR : Question about programming : REPLY
Hello,
only for some chips : you can do an atmega-arduino bootloader, but you need a arduino uno first
I find that in french : [url]http://itechnofrance.wordpress.com/2013/04/13/construire-un-arduino/[/url]
Bascom use special programmer tools for Arduino working perfect.
bon courage
jp :wink:
↧
↧
BASCOM-AVR : Question about programming : REPLY
My opinion:
As a beginner, I would not spend time and money in an "as cheap as possible" programmer. What a beginner needs is a reliable, rock solid programmer, like the AVR MK2. Imagine your first project (the flashing Led) does not work. Then you cannot be shure if the cheap programmer is to blame.
Remember: Only an exerienced craftsman can work with cheap, worn, rusty pliers...
The beginner needs the best tools he can get!
↧
BASCOM-AVR : Question about programming : REPLY
Well i have to finish something in the next few days and i can't get a programmer on such short notice so i will have to try the serial/lpt method and hope it will work.
↧
BASCOM-AVR : coupling 2 atmega via RS 232 or SPI ? : NEWTOPIC
Dear All,
I am kindly asking for your advice how I may proceed.
I programmed a ATMega328 ( = CPU A) to control the movement of a stepper motor ( basically creating signals e.g. stepper-clock, direction, halfstep/fullstep) and write position data to a LCD display.
As the LCD display is a little bit slow ( this is what I think because the hickup correlates with writing) I decided to write to the LCD Display once every 200 stepper-clocks. I am using the library lcd4busy_anypin.lbx
While the motor is in movement this writing to the display causes some hickup in the movement of the stepper motor. I want to avoid this. It sounds ugly.
My idea is to use an ATMega 8 ( = CPU B) for handling the display communication.
CPU A takes care of the communication with the PC only when motor is not moving. CPU A needs the hardware UART of CPU A for this purpose.
CPU A handles also 2 push buttons that have several functions.
One function of the pushbuttons is scrolling the display.
So CPU A has to transfer to CPU B that a scrolling operation has to be peformed.
CPU B receives the data to display during the init routine of CPU A or after a command arrives from the PC. This does not happen very often.
The typical operqtion is that the ionformation of the actual position is tranferred after a movement is finished.
So CPU B is only listening to CPU A and writing to the display.
I see two possibilities:
#1: Programming a software RS 232 on CPU A and connect it to the hardware RXD of CPU B.
Advantages:
This method occupies one pin on each CPU only.
On the listening CPU B I can use the all the comfortable BASCOM features for RS 232 including ringbuffer and bytematch.
With this kind of operation like catching the frame etc.
I have some experience with RS232 communication.
Disadvantage : It is relatively slow.
#2: Using HW SPI on both CPUs.
As far as I could read it in the documentation of the processors, BASCOM help-files and the samples SPI communication is very fast.
I need the SPI interface for traferring the code via the programmer into the flash memories.
My idea is to connect the CPU via a special cable from one SPI socket to the other.
Advantage: very fast data transfer.
Disadvantage:
Consumption of at least 3 pins on each CPU.
I have no experience using the SPI interface.
Handling of a ring buffer on CPU B has to be programmed by me.
The comfortable BASCOM feaures are not available.
If I could send the data in one array of bytes string and read it into one big array of bytes I may come along using an overlay construction. This would help.
I started reading about I²C . To my feeling it is like using a cannon against sparrows. Perhaps i am wrong.
I am also considering stay with one CPU and speed up the system clock from 6 MHz to e.g. 16 MHz.
The operations within the CPU will be handled faster. I doubt that writing the data to the LCD display is performed faster.
But it has the advantage that the board will not be so much crowded.
Please let me have your advice.
best regards
Christian
[b:99d51fe4fe][color=red:99d51fe4fe](BASCOM-AVR version : 2.0.7.7 )[/b:99d51fe4fe][/color:99d51fe4fe]
↧
BASCOM-AVR : coupling 2 atmega via RS 232 or SPI ? : REPLY
Hi,
Why not use an ISR (Interrupt service routine) to handle the stepper motor. I've done something like that for a board with a LCD and a L297/L298. The main loop calculates how often the ISR should fire and the ISR just toggles the correct pins.
Regards
Ian Dobson
↧
↧
BASCOM-AVR : ATXmega 384C3 code size limit? : NEWTOPIC
Hello,
I have a strange problem with my program size.
I use the ATXmega384C3 with compiler version 2.0.7.7/build 2.0.7.7.004
At round about 81% Flash size I can't add any code line getting one more compile error each line:
Error : 61 Line: xxxx Label not found [_RAMPZ5 ], in File : xxxx
It doesn't matter, what I add...
Does anyone can help me, I'm in big trouble?
Thaks a lot.
Kindly regards,
Frank
[b:e0ab6dfa97][color=red:e0ab6dfa97](BASCOM-AVR version : 2.0.7.7 )[/b:e0ab6dfa97][/color:e0ab6dfa97]
↧
BASCOM-AVR : ATXmega 384C3 code size limit? : REPLY
Hi Frank,
81% of 384Kb is a huge Bascom program.
Your bug sounds like a compiler bug, contact support with an exact description of the problem.
Regards
Ian Dobson
↧
BASCOM-AVR : double < 0 : NEWTOPIC
Dim test as double
test = 12345
IF test < 0 then 'some time fail
.
.
.
IF test < 0.0 then 'work good
.
.
.
why?
[b:fb21a3a560][color=red:fb21a3a560](BASCOM-AVR version : 2.0.7.7 )[/b:fb21a3a560][/color:fb21a3a560]
↧
BASCOM-AVR : double < 0 : REPLY
0 and 0.0 are the same and will give the same result. if you compile 2 different samples and compare the output you will find they are (binary) identical.
so please produce a sample that demonstrates this problem.
Or send a sample/code to support.
↧
↧
BASCOM-AVR : coupling 2 atmega via RS 232 or SPI ? : REPLY
yes it is simplest to use a timer ISR. It can create all signals.
you can use a byte variables named bStepSate and check its value in the ISR. Then based on the value you take some action and change the value/state.
Depending on the frequency it will give some load on the system while executing but it will not slow down the main code much.
when splitting tasks you can use i2c. it is very simple and reliable. when having enough pins you could use SPI ot shiftin/shiftout as well.
i2c slave works in interrupt mode so i would use that, but my first choice would be to put the code in the main chip.
↧
Share your working BASCOM-AVR code here : MAX31855 Thermocouple : REPLY
Thank you for sharing ! Good example for SHIFTIN.
↧
BASCOM-AVR : double < 0 : REPLY
http://wiki.mcselec.com/bavr/Language_Fundamentals/#Floating-Point_Complications
↧