Just my 2 cents:
- As stated above a crystal on XMega is important for stable communication. You are dealing with a lot of power -> a lot of heat. This affects the stability of a RC oscillator a lot.
- I would use nested interrupts. The timing has to be calculated but I can imagine that it could work. So use buffered serial for incoming data in your tile, and allow the interrupt for serial in your timer0 isr. You have to make shure that timer0 int is disabled (avoiding that the isr is called twice) and increase the hw-stack. For stable display I also would latch first and then load the LED pattern to prepare the next latch. By doing this interrupts of incoming data don't affect the timing of LED pwm:
[code:1:65b40be998]
timer0_int:
'turn off active LED bank
'latch the data to the outputs of the LED driver
'turn on prepared LED bank
disable timer0 'avoid multi call to isr
enable interrupts 'allow nested interrupts, aka buffered serial in
'now prepare next LED data by SPI to the driver
disable interrupts 'prepare reenable timer0
enable timer0 'reenable timer0
return
[/code:1:65b40be998]
- I would also do double buffering for stable display. That means incoming data will be stored in buffer A, while buffer B is displayed. When all data arrived, a flag is set and the isr starts to display buffer A. Now buffer B is ready to be filled with incoming data.
Hardware: IMHO you have a poor-gnd-problem.
- You have a lot of ground loops in your setup: power supply -> (power cable) -> tile 1 -> (data cable) -> tile2 -> (power cable) -> power supply.
- You have a reasonable resistance in your power cable. As I can see you are using AWG28 ribbon cable with about 216mOhms/meter (that is about 70mOhms/feet, but lets stay metric here). With 5 parallel lines you have 43mOhms/m. Assuming a cable length of 1 meter and a peak current of 10A you have a peak drop of 0,4V. This with 1kHz pwm.
- All this with 3 power supplies put together only by the data cable.
For me it sounds pretty noisy. Can you measure whats going on in your gnd lines?
↧
BASCOM-AVR : Serialin and data corruption : REPLY
↧
BASCOM-AVR Old versions : esp8266 web server : REPLY
Try Search Forum at the top
search for esp8266 or ENC28J60
↧
↧
BASCOM-AVR : Serialin and data corruption : REPLY
Hi laborratte !
Double buffer in Ram of the Mega8 is a good idea :!:
Nested interrupts are not required in this Tile-design, IMO. I did the math. Even with SPI as low as 4Mhz and Buffered Serial in @ 115kbaud, the two don't interfere. Intensity variation caused by Buffered Serial In on the Scan task is less than 1%. At 150Hz refresh for the tile, thus 300Hz for the Scantask, the 3.3ms is 300 times higher than the let's say 10us for the Buffered Serial In int handler. I am convinced that's not visible. :)
Techknight, was the program I posted here: [url]http://www.mcselec.com/index2.php?option=com_forum&Itemid=59&page=viewtopic&p=70826#70826/url] usefull to you ?
↧
BASCOM-AVR : Serialin and data corruption : REPLY
Have you set the double speed bit on the mega8 this brings the SPI bus to half the CPU clock?
Regards Paul
↧
BASCOM-AVR : Serialin and data corruption : REPLY
Yes :)
My point was: even with that double speed SPI bit not set, there will be no character lost in the serial handler.
↧
↧
BASCOM-AVR : Write string variable to the DATA EEPROM : REPLY
Please look at the samples files, and the search index
jp
:wink:
↧
BASCOM-AVR Old versions : TIMER : NEWTOPIC
Hi ALL :
How can I create (TIMER0 & TIMER1) to make every province (0.25 Second) and is to be placed Please values
Please, I need to provide me with an example of what I want
↧
BASCOM-ARDUINO : TFT 5inches, ssd1963 and Mega 2560 : REPLY
HI Duval JP
Can I get your email?
↧
BASCOM-AVR Old versions : TIMER : REPLY
Hi,
Ian Dobson made a nice tool for timers "AVR Timer 1.25"
you can download it [url=http://www.planet-ian.com/page12_e.htm]here [/url]
↧
↧
BASCOM-AVR Old versions : TIMER : REPLY
hi kim
See Kim!!!!
↧
BASCOM-AVR Old versions : TIMER : REPLY
Its OK to download
it's a browser block just select keep file
↧
BASCOM-AVR Old versions : TIMER : REPLY
Can you give me an explanation "for the program, Kim and thank you" to you
↧
BASCOM-AVR Old versions : TIMER : REPLY
Hi,
Simply put, tell the program what your Crystal is and what Interrupt rate you want, the program calculates the correct values for you.
When you click on the prescaler value (bottom right) the program Displays the Bascom Code.
Regards
Ian Dobson
↧
↧
BASCOM-ARDUINO : TFT 5inches, ssd1963 and Mega 2560 : REPLY
Samgsm,
Would you please explain why you request my Email, I agree to make private discussion but, let me know the subject and your Email, I will send back a answers.
Regards
:wink:
JP
↧
BASCOM-AVR Old versions : TIMER : REPLY
Thank you "i.dobson for clarification :wink:
↧
BASCOM-ARDUINO : TFT 5inches, ssd1963 and Mega 2560 : REPLY
I need help from you in the ECG project and use the screen 7 "TFT please"
↧
BASCOM-ARDUINO : TFT 5inches, ssd1963 and Mega 2560 : REPLY
Thank you for your trust, I do not know if I am able to answer you...
and I do not know if a M2560 is sufficient in terms of clock speed.
How do you get this curve? It is a voltage from a sensor, I guess
in how much time is it measured?
Ben Zijlstra , H. kipnik six1 did a nice job with a 7" display and a XMEGA at 32Mhz
[url]http://wiki.mcselec.com/7_inch_display_board[/url]
my experience with 5-inch showed me that the display of drawings takes time.
You should try to start by tracing a voltage from a function generator, this is not very difficult, measure the voltage
transform in pixel and display the points in X Y, the problem is that to refresh the screen it is not instantaneous as an oscilloscope
Anyway,
go by step and good luck!
JP
↧
↧
BASCOM-ARDUINO : SSD1306 Oled I2c 0.96 inch : REPLY
[i:59f2491aa5][b:59f2491aa5]glcdSSD1306.lib[/b:59f2491aa5][/i:59f2491aa5] not work on Xmega. CPU hangs. In this example even LED flash not work.
[code:1:59f2491aa5]$regfile = "xm256a3budef.dat"
$crystal = 32000000
$hwstack = 100
$swstack = 100
$framesize = 100
Config Osc = Disabled , 32mhzosc = Enabled
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
Dim Count As Byte
Led Alias Portd.2 : Config Portd.2 = Output
Dim Twi_start As Byte
Config Twic = 400000
I2cinit
$lib "glcdSSD1306.lib"
'************************** Here LED flashes
For Count = 1 To 8
Toggle Led
Waitms 300
Next Count
'************************** After this string CPU hangs
Config Graphlcd = Custom , Cols = 128 , Rows = 64 , Lcdname = "SSD1306"
'************************** Here LED not flashes
Do
Toggle Led
Waitms 100
Loop
End[/code:1:59f2491aa5]
↧
BASCOM-ARDUINO : SSD1306 Oled I2c 0.96 inch : REPLY
My little investigation take me into Xmega.lib
Address for register of I2C channel is keeped in Z so R30 and R31 cannot be altered.
But LPM for reading from flash uses R30 and R31 so in first when InitLCD read data from flash with LPM then Z is blurred and address for I2C reg is broken
I test this because when I wrote like this
[code:1:abc2696fd1]ldi r17,&H78
Call _i2c_write
ldi r17,&HAE
Call _i2c_write
ldi r17,&HD5
Call _i2c_write
ldi r17,&H80...
..etc (data for init)[/code:1:abc2696fd1]
then Ihave progress..
I can even CLS when I change Loop for 1024 bytes for sending $00 builded on R30|R31 to R28|R29
But now for LCDDAT again LPM is used and so on :D
I`m not that good so my experiments can take time but I feel this like very interesting learning :D
↧
BASCOM-AVR : Serialin and data corruption : REPLY
I noticed that transistors Q8, 10, and 17 are in parallel, presumably for increased current drive capability.
My brain is old and tired, and I understand that some FETs don't experience thermal run away like older bi-polar transistors, (their S-D current decreases as their temperature increases, instead of the other way).
That said, I didn't see the model number for the transistors in use.
It would be worth verifying their thermal run away characteristics in the data sheet.
Even a very low series resistor can help significantly with low leveling between the three.
With the wide variety of power FETs available these days I wonder if there is some advantage to using the paralleled configuration instead of a single device rated for the current required?
JC
↧