Home › ELEKTOR FORUMS › DigiButler (April & May 2008) › Digibutler evolution

ELEKTOR FORUMS

Please log in to post a reply or subscribe / unsubscribe to topics

Topic: Digibutler evolution

Author Post

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 08-12-2008 13:36

Hello,

I would like to explain my progress with DB

I think the coldfire is a good µP for experiences, that's why I chose DB.

Because web pages in flash don't leave enought flash memory to store user programms,
i decided to store these web pages in a SD card.

Here is step after step DB life:

----- V1.0 ----- 2008 08 15 begin
1/ Mounting DB board and TBLCF(programm it cf doc)
2/ Compile and flash elektor sources with only one modif: IP address
status Ok no problem

3/ Write program to acces QSPI CFire and connect 6 wires
(SS, SCK, MOSI, MISO +alim) to SD card
4/ Adapt EFSL ( Embedded File System Library ) by Lennart Yseboodt and Michael De Nil.
status I could read files writen on SD card with the PC

5/ Change http server FLASH file acces by EFSL file acces
6/ Modify http server to add http descriptor before files
( the descriptor was added by emg_dynamic_ffs.exe )
7/ Change elektor web pages to use 8+3 filename ( EFSL is 8+3 )
status IExp and FFox can read pages

8/ Because changing files on SD is difficult (extract SD, put in PC...reset DB),
i wrote a special client "h_trans.exe" (VC6.0 project) for the PC to do that.
9/ The server layer is through http port 80 ( FTP tunnel )
10/ When i wrote the server layer i found a bad test of joshua key
status the dialog between DB and PC client seems to be correct

----- V1.1 ----- 2008 09 -- SPI software
11/ the fragility of connections ( QSPI SD ) is too high
12/ i decided to use 4 portIO as SPI software
13/ i choosed portAN4, 5, 6 et 7
14/ i lost 4 analog inputs but connections are easy (J7)
15/ few lines of code and the SPI software works as well as hardware
status SPI software OK no significant problem of timing

----- V1.2 ----- 2008 10 10 Camera C328R
16/ I read in elektor that we could use a camera C328R ( serial )
17/ CFire has 3 uarts: uart0 used by debug line, uart1 inaccessible (like QSPI)
18/ we can use uart2 (tertiary function of SDA SCL lines) on J6-2 and J6-4
19/ I had some problems to use uart2:
2 defines MCF_GPIO_PASPAR_SCL_TXD2
and MCF_GPIO_PASPAR_SDA_RXD2 are false in "mcf5223_gpio.h"
20/ few lines of code to test camera
status i can read camera with the command line, but a few times, the camera freezes during launch

----- V1.3 ----- 2008 11 01 IO expander
21/ I need more IO than the 3 IO available on the board
(1 to switch on/off camera and 4 to drive a stepper motor)
22/ i decided to use an IO expander MCP23S17 ( microchip )
23/ like SD card driver, i use the 4 IO TOR on J6 to drive by SPI the MCP23S17
24/ the SPI driver of IO expander is called every 5ms by "timer_isr()"
25/ because the driver period, the relay output is still operational
( driver restore the relay value before exit )
26/ there is only LED flickers a little
27/ 1µF capa mounted on R7 solves the problem
status IO expander works correctly

----- V1.4 ----- 2008 11 05 Correction bugs
28/ correction of bugs that i made in http server (V1.0)
29/ change http header parser methode to remove bytes until GET request finished
status system works

----- V1.5 ----- 2008 11 11 Camera following
30/ add NCV4276 (regulator enabled) to switch off/on camera
( one output bit MCP23S17 )
31/ establishment of a state machine for managing the camera
( init, capture, write in a file... )
32/ when i created a new task to run the state machine, i received calloc errors
33/ so integration of the state machine in "tk_misc.c->tk_keyboard()" that has nothing to do
status http client can read the camera jpeg file

----- V1.6 ----- 2008 11 15 Camera guidance
34/ add a hook to move the camera with http client (like switch on/off relay)
35/ func "form_camera_function" in "freescale_static_ffs_utils.c" when we receive "?camera&xxx"
36/ this function invoke CAMERA_action(xxx)
status OK when we move the slider in http client, DB print: position(xxx)

----- V1.7 ----- 2008 11 29 Stepper motor
37/ Management stepper motor to position the camera
38/ add ULN2803A connected on MCP23S17 to drive unipolar stepper motor (floppy disk)
( 4 output bits MCP23S17 )
39/ few lines of code
40/ "Control_Motor()" called by "IO_SPI.c->IO_Update()" every 5ms
the speed ( 200 steps/sec ) is fast enough for me
2 user functions:
MOTOR_SetPosition() set new motor target
MOTOR_GetStatus() return target reached or not
41/ add a potentiometer to read the motor position
42/ now, CAMERA_action(xxx) positions the camera before capture
status OK http client can position camera and capture jpeg

----- V1.8 ----- 2008 12 06 C328R preview mode
43/ the dynamic with jpeg capture is bad
44/ i added C328 preview mode ( 80x60 16greys ) in camera state machine
45/ to succeed, i must recover the available RAM on the board
46/ i needed 2518 bytes to alloc bmp buffer
47/ * 512 suppress gFile in FMS.c
48/ * 1280 in reducing the boot stack from 0x800 to 0x300 "mcf5223evb_iflash.lcf"
49/ * 640 in "http_tunnel_ftp.c"
50/ * 1552 in reducing NUMBIGBUFS from 8 to 7 "ipport.h"
51/ writing in the bmp buffer is made by the driver irq
52/ modify file manager "FMS_ReadFileInfo()" and "FMS_read_bloc()" to read buffer or SD card
53/ http server can read asynchronously the bmp without waiting for the end of grab
54/ modify CAMERA_action(xxx) to have only one http client who moves camera
status OK http client can move camera in preview mode every second and capture jpeg when press button


------------------------------------------------
In this state, we can read in xMAP file that 0x1AA68 are used in flash memory
section .text uses 0x0 to 0x1A5C0
section .data uses 0x4A8 stored in ___DATA_ROM

------------------------------------------------
If somebody wants to use more than 4 analog inputs,
i think it is possible to use PTC[0-3] (quaternary function of DTIN0-3).
These signals are available on RN1 and RN3.
of course, we must change the code.

Digibutler files ( CodeWarrior 6.3 project ):
"DigiButler software aaaa mm jj.zip"
.\DigiButler software\
Doc\
Digibutler.rtf historic (fr)
Hardware.pdf Electronic schematic i use( EAGLE4.15 Elektor(fr) nov 2005 )
screen\ some screen copy
site\ my web pages to test DB. must be loaded on SD card (by h_trans.exe)
SW_Main_Board\src\projects\
camera\ camera manager
EFSL\ Embedded File System Library ( not used as library )
exemple\ Elektor sources
IO\ IO expander and stepper motor control
NicheLite\ Elektor sources
web_page\ Elektor web pages


Annexe ( VC6.0 project ):
"H_Trans.zip" FTPTunnel client software

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 14-12-2008 22:46

Hello,

Digibutler following

----- V1.9 ----- 2008 12 13 CodeWarrior 7.1
55/ install CodeWarrior 7.1 + compile DB project: no problem
56/ hic the programm didn't run
56/ CW7.1 doesn't protect registers in _asm{} C functions. CW6.3 do that
57/ save registers used in functions spiSend() and spiSendNoCS() "SD_card.c"
58/ save registers used in function IOspiSend() "IO_SPI.c"
status DB prog runs correctly

59/ stack adjustment for tasks "Main" (too small) and "clock tick" (too big)
60/ set variables as volatile ("camera.c") for use Level4 optimization
61/ suppress uart1 "iuart.c" (it uses RAM and is not accessible)
62/ set irq mode for uart0: printing is faster
status CW7.1 DB prog works

"elektor.mcp" is CW6.3
"elektor7.1.mcp" is CW7.1

------------------------------------------------
At this state, we can read in xMAP file that 0x19708 are used in flash memory
section .text uses 0x0 to 0x19280 (optimization Level1)
section .data uses 0x488 stored in ___DATA_ROM

Digibutler files:
"DigiButler software aaaa mm jj.zip"
.\DigiButler software\
Doc\
Digibutler.rtf historic (fr)
Hardware.pdf Electronic schematic i use( EAGLE4.15 Elektor(fr) nov 2005 )
screen\ some screen copy
site\ my web pages to test DB. must be loaded on SD card (by h_trans.exe)
SW_Main_Board\src\projects\
camera\ camera manager
EFSL\ Embedded File System Library ( not used as library )
exemple\ Elektor sources
IO\ IO expander and stepper motor control
NicheLite\ Elektor sources
SW_Main_Board\build\m5223evb\
elektor.mcp CW 6.3 project
elektor7.1.mcp CW 7.1 project
web_page\ Elektor web pages


------ in progress -----------------------------
I downloaded a new version of ColdFire_Lite TCT/IP (DB basis) from Freescale site.
It seems to be better than DB's (FEC init...).
After added DB functions (authentification...), it works.
Is it a good choice or not?
Can somebody help me to test it?

Digibutler ColdFire_Lite files:
"ColdFire_Lite_V30 aaaa mm jj.zip"
.\ColdFire_Lite_V30\
build\cw\m5223x_evb\
elektor7x.mcp CW7.1 project
src\projects\
camera\ DB
EFSL\ DB
exemple\ DB
IO\ DB
NicheLite\ New stack sources


sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 09-01-2009 19:45

Hello,

Digibutler following

----- V1.10 ----- 2008 12 30 Telnet Server
63/ Change uart irq mode: we can pipe fifos.
64/ Build simple telnet server task
status telnet works

65/ add autorization (login+password) like http
status telnet works

----- V1.11 ----- 2009 01 05 Corrections
66/ CFire RAM is too short for many tasks (calloc1 failed)
Suppress telnet task
68/ Append hook in http server task
2 functions HL_task_init() et HL_task_check() called from freescale_http_server.c
These functions call Telnet_init() and Telnet_check()
In this way, we use http stack
constraint1: sockets need to be non bloquant
constraint2: wake up host task in callback socket "TK_WAKE(&to_emghttpsrv);"
status DB works without calloc failed

----- V1.12 ----- 2009 01 06 SNTP Client ( Simple Network Time Protocol )
69/ Add SNTP client to update RTC
SNTP process like telnet is activated from HL_task_xxx()
70/ Interrogation of a list of SNTP server every 10 seconds until a server responds
71/ Update RTC with server datas
72/ Relance after 8 hours of waiting
status SNTP seems to work correctly

----- V1.13 ----- 2009 01 08 Time-stamped trace file
73/ Add trace file with time-stamped events
74/ Event Sntp success ( server IP address )
75/ Event Http connection ( client IP, user, password OK or KO )
76/ Event Telnet connection ( client IP, user, password OK or KO )
status tracing is ok

"elektor.mcp" is CW6.3
"elektor7.1.mcp" is CW7.1

Digibutler files:
"DigiButler software aaaa mm jj.zip"
.\DigiButler software\
Doc\
Digibutler.rtf historic (fr)
Hardware.pdf Electronic schematic i use( EAGLE4.15 Elektor(fr) nov 2005 )
screen\ some screen copy
site\ my web pages to test DB. must be loaded on SD card (by h_trans.exe)
SW_Main_Board\src\projects\
camera\ camera manager
Telnet\ telnet server
EFSL\ Embedded File System Library ( not used as library )
exemple\ Elektor sources
IO\ IO expander and stepper motor control
NicheLite\ Elektor sources
SW_Main_Board\build\m5223evb\
elektor.mcp CW 6.3 project
elektor7.1.mcp CW 7.1 project
web_page\ Elektor web pages

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 06-02-2009 13:06

Hello,

Digibutler following


----- V1.14 ----- 2009 01 28 SPI software sur TIN0-3
77/ Using TC port to drive SD card
78/ Connect SD card to RN1 and RN3 resistors (easy)
- SD.7(MISO) to RN3.7(TIN3)
- SD.2(MOSI) to RN3.6(TIN2)
- SD.5(SCK) to RN1.6(TIN1)
- SD.1(SS/) to RN1.5(TIN0)
shematic "Doc\HardDigilogger.pdf"
This restores the 4 analog inputs (V1.1)
Soft activ or not with #define SPI_USE_PTC (SD_card.c)
status DB works

79/ hic, programm crashes
there is a lot of access to port MCF_GPIO_PORTTC (residues MC52233DEMO board who has LEDs)
80/ Remove all unnecessary access to the register MCF_GPIO_PORTTC
status DB works correctly

----- V1.15 ----- 2009 02 02 DataLogger
81/ Using as DataLogger (record time + IO Tor and Ana)
Soft in "DataLogger.c" activ or not with #define HL_DATA_LOGGER in "ipport.h"
We can use or not TIN0-3 (v1.14) for 4 or 8 ana
- If we have 4 ana (SPI v1.1), the values of ANA4-7 have no meaning (disconnected)
82/ The configuration is a text file "config.cfg"
83/ There are 4 modes of archiving non-exclusive (selective activation)
- periodic (1 to 3600 seconds)
- to date (once when the date is reached)
- on rising, falling or all edges on one or more Tor input
- on ana variation ( or #) to a value
84/ For the time-stamped events, we must activate the SNTP client (v1.12)
or update the RTC with the "date" and "time"
85/ Event control is done every second
86/ The records are written in a binary file "*. dat" (24 bytes each record)
87/ Add 3 commands dlstate, dlconf and allow dlrecord
- dlstate displays the status of the datalogger
- dlconf configure datalogger and save in "config.cfg"
- dlrecord shows the records
88/ These commands are accessible via Telnet (v1.10)
status DB datalogger works

89/ To have a nice interface,
90/ extension FTP Tunnel (v1.0) to configure datalogger
91/ H_Trans (Annex) was changed to a holding friendly datalogger
- WYSIWYG configuration file "config.cfg"
- association file extension with an executable
- converting record files (binary) to text to be open with "notepad" or "excel"
status DB datalogger works

"elektor.mcp" is CW6.3
"elektor7.1.mcp" is CW7.1

Digibutler files:
"DigiButler software aaaa mm jj.zip"
.\DigiButler software\
Doc\
Digibutler.rtf historic (fr)
Hardware.pdf Electronic schematic i use( EAGLE4.15 Elektor(fr) nov 2005 )
HardDigilogger.pdf DataLogger electronic schematic
screen\ some screen copy
site\ my web pages to test DB. must be loaded on SD card (by h_trans.exe)
SW_Main_Board\src\projects\
camera\ camera manager
Telnet\ telnet server
DataLogger\ datalogger process
EFSL\ Embedded File System Library ( not used as library )
exemple\ Elektor sources
IO\ IO expander and stepper motor control
NicheLite\ Elektor sources
SW_Main_Board\build\m5223evb\
elektor.mcp CW 6.3 project
elektor7.1.mcp CW 7.1 project
web_page\ Elektor web pages

Annex ( VC6.0 project ):
"H_Trans.zip" FTPTunnel client software (IHM datalogger)
H_Trans\Release\H_Trans.exe

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 14-02-2009 10:08

Hello,

Digibutler following

----- V1.16 ----- 2009 02 05 SMTP Client ( Simple Mail Transfer Protocol )
92/ Add SMTP client to send emails
93/ Activ or not with #define HL_SMTP_CLIENT in "ipport.h"
Source code in "smtp.c"
94/ SMTP process like telnet is activated from HL_task_xxx()
95/ The #define HL_SMTP_SERV_IP sets smtp server IP ( nslookup smtp.server.com )
96/ A user function SM_SendEmail( dest, subject, message) is available
97/ Add "smail" command for test
status send a mail works

----- V1.17 ----- 2009 02 11 DataLogger + expander + send eMail
98/ Use IO Expander MCP23S17 (V1.3) any input
99/ hic, expander inputs don't work
100/ Fix bug: bad init MCF_GPIO_DDRTA in "IO_SPI.c"
status Expander inputs run

101/ Activ expander with #define HLA_HARDWARE in "ipport.h"
102/ In this mode, DLog wins 16 IO tor
However, we lose GPT1-3 used to drive the expander (V1.3)
103/ Now, each bit TOR is individually programmable
on falling, rising or all edge
104/ Add to send an email for each event (except periodic)
105/ Update "dlstate" and "dlconf" commands (v1.16)
for managing SMTP client and expander
106/ Adaptation of H_Trans to manage the new functions
- selective programming of each bit (including expander)
- programming SMTP server IP address
- programming recipient email address
status DB datalogger works

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 01-03-2009 12:19

Hello,

Digibutler following

----- V1.18 ----- 2009 02 23 Configuration file
107/ Reading configuration in a file "dbconf.cfg"
108/ Allows to change settings:
- MAC address (same soft for many DB)
- IP, Mask, Gateway
109/ UsersPass, UploadKey
Activ or not with #define CONFIG_FILE in "ipport.h"
The file "dbconf.cfg" must be edited on the PC and loaded on SD card
model in "site\dbconf.cfg"
status DB read file correcttly

110/ Add "attrib" command in the disk of the menu which gives the
attribute (H)ide to a file read by FTP loader H_Trans (who should not know users)
status Files with H attribut are not saw

----- V1.19 ----- 2009 02 28 Camera MCA-25
111/ Add sony camera on the same serial port than C328R
Ton Augustin source code ( topic "Another CAM for DigiButler" )
112/ This camera has a reset pin and requires no additional hardware
Completely connected to J6
- J6.1 +3V3
- J6.2 Gnd
- J6.3 Sda (tx mca25)
- J6.4 Scl (rx mca25)
- J6.7 Gpt2 (reset mca25)
113/ Activ or not with #define MCA25_TASK in "ipport.h"
114/ There is a subset of XY position with 2 RC servos
drived by PWM and connected to J6
Source code in "mca25.c", "comm2.c" and "servo.c"
status DB works

Of course, we can activate only one camera (MCA25 or C328R)

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 14-05-2009 21:26

Hello,

Digibutler following

----- V1.20 ----- 2009 03 11 Disk accessories
115/ Add CD command in disk menu
Write current path after prompt
Update directories date and time
status DB works

----- V1.21 ----- 2009 03 29 SNTP and the daylight saving time
116/ After switching to daylight saving time, DB is not out of date
117/ The correcting value is SNTPoffsetGMT ( second )
118/ Add a line in the conf file (v1.18) to programm SNTPoffsetGMT
status DB works

----- Big modifs: we change version -------------

The name change
- from "DigiButler software aaaa mm jj.zip"
- to "DigiButler_V30 aaaa mm jj.zip"

The project is only CW7.1 ( CW6.3 canceled )


----- V2.00 ----- 2009 04 05 Using new version of Nichelite
118/ Using new code downloaded from Freescale site (still Nichelite stack)
119/ Adapt code to run on digibutler
status DB works

120/ Translating code (v1.21) into new stack
Attention files organisation is different
The binary file (ELF) to load on DB is "WebAutomation"
121/ "H_Trans.exe" ( VC6.0 ) is dropped
122/ The successor "H_Digibutler" is write with "Microsoft Visual C# 2008" (Free)
It has the same features
It is my first csharp programm
status DB works, and dialog with "H_Digibutler" also

----- V2.1 ----- 2009 05 09 Adding IO TOR board for datalogger
123/ Build an expansion board with 16 Inputs 24Vdc + 8 Outputs relais
Use 2 expanders MCP23S17 connected on J6 (v1.3)
We can connect many boards ( addressing boards )
124/ There is a parameter #define NB_IO_EXPANDERS 2 (for one board) in "ipport.h"
125/ Update IO manager for many expanders
Soft in "IO\IO_SPI.c"
126/ Update "Datalogger.c" for many expanders
127/ Update "H_Digibutler.exe" to browse datalogger records
status DB works

At this stage, i made a prototype (veroboard) of the IO expansion.
I made schematic, placement and routing of the board (EAGLE 4.15).
I expect Elektor Service PCB works (presented in the June issue).


NEW TREE FILES:
"DigiButler_V30 aaaa mm jj.zip"
.\DigiButler_V30\
--- Doc\
------ Digibutler_V30.rtf ____ historic (fr)
------ Hardware.pdf __________ Electronic schematic i use( EAGLE4.15 Elektor(fr) nov 2005 )
------ HardDigilogger.pdf ____ DataLogger electronic schematic
------ Expander_xxx __________ IO expansion board 16 Inputs 8 Outputs
--- screen\ __________________ some screen copy
--- site\ ____________________ my web pages to test DB. must be loaded on SD card (by H_Digibutler.exe)
--- build\cw\m5223x_evb
------ DigiButler_V30_7x.mcp _ CW 7.1 project
--- src\
------ cpu\mcf5223x
--------- processor.h ________ New defines
------ projects\
--------- camera\ ____________ C328R camera manager
--------- comm2\ _____________ MCA25 camera manager
--------- DataLogger\ ________ datalogger process
--------- EFSL\ ______________ Embedded File System Library ( not used as library )
--------- example\ ___________ Freescale sources
--------- IO\ ________________ IO expanders and stepper motor control
--------- NicheLite\ _________ Freescale sources
--------- Telnet\ ____________ Telnet server


Annex ("Microsoft Visual C# 2008" project):
"H_Digibutler.zip" ___________ FTPTunnel client software


sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 18-06-2009 21:00

Hello,

Digibutler following


----- V2.1 ----- 2009 06 09 Adding IO TOR board
128/ I received 3 boards from Elektor Service PCB
Mounting and checking one board / three
status DB + IO extension work

129/ Mounting second board
Connecting 2 boards on DB
status DB + 2 IO ext work

Today, i don't have enough expanders for third board

----- V2.2 ----- 2009 06 09 Programmable Logic Controller
130/ Adding a PLC function (Programmable Ladder)
It is an interpreter code who is generated by a software on PC (H_DigiPLC.exe)
131/ Activ or not with #define HL_PLC 1 in "ipport.h"
Source code in "plc.c" and "plc.h"
132/ PLC engine read and load in RAM the file "plc.txt" generated by "H_DigiPLC"
The code is loaded and then run once to measure its time to work (around 10µs)
133/ Then it is executed periodically every 5 ms
134/ The software "H_GigiPLC" wrote with "Microsoft Visual C # 2008" is a recasting of "H_Digibutler" (v2.0)
"H_DigiPLC" (MDI) includes more:
- A graphic Ladder editor
- Compiler: transformation of the graph in code used by the PLC engine
- A loader: transfer the generated file "plc.txt" to Digibutler
- Start/Stop PLC engine on Digibutler
- Autorun: allows to run automaticaly after reset Digibutler
- Monitoring: graphical animation according to the state of IOs
135/ See documentation "H_DigiPLC"
status DB runs PLCcode made by H_DigiPLC

There is some PDF in directory "\DigiButler_V30\Doc\":
Electronic schematic : "IO_EXP_01A.pdf"
Components list : "IO_EXP_01A_components.pdf"
Placement : "IO_EXP_01A_SER.pdf"
Assembly : "IO_EXP_01A_montage.pdf"

The only file i sent to Elektor Service PCB "IO_EXP01A.zip (29/05/2009 10h34)"



Annex ("Microsoft Visual C# 2008" project):
"H_DigiPLC.zip"
Sources "H_DigiPLC.exe" written with "Microsoft Visual C# 2008"
- FTPTunnel client software ( transfer files PC Digibutler )
- Datalogger: configuration and browse records
- PLC: graphic editor ( Ladder ), compiler et monitoring


sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 25-06-2009 20:24

Hello,

Digibutler following

----- V2.3 ----- 2009 06 25 PLC Addition of functions
136/ Outputs are not exclusively boolean any more
137/ Addition actions on integers
- Move ------- assignment
- Add, Sub --- Arithmetical operators
- And, Or, Xor logical operators
- Lsr, Lsl --- shifts
138/ PLC goes to V1.1
139/ H_DigiPLC integrates the new features (see doc).
status DB works

These functions allow to count the events on the IO TOR.

I was afraid by bounces on the sensors.
But with a scantime of 5ms and by using edges, they don't perturb me.
Then if somebody has problems with bounces, we will install a fast debounces software (to replace some MC14490).

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 05-09-2009 11:27

Hello,

Digibutler following

----- V2.4 ----- 2009 09 04 PLC monitoring via FTP Tunnel
140/ In V2.3, the dialogue PLC uses 2 connections (one for the commands and one for monitoring).
141/ Reducing to one connection to a port on ARM7 (ARMee) without ethernet
142/ The monitoring PLC is now made via the HTTP server (FTP Tunnel)
143/ Adding commands monitorong in FTP Tunnel
- SITELC:MON1 for objects monitoring
- SITELC:MON2 for variables monitoring
status DB works with monitoring via HTTP connection

144/ Limiting records to SD card in the dialogue PC DB
145/ When FTP Tunnel generates a small response, it is stored in a buffer and not on SD card.
- This feature is necessary to PLC monitoring, which makes periodic requests and seeks EFSL->SDcard (CPU load + SDcard aging).
146/ Increase HTTP server stack (0x800 => 0x880) because a little bit limit with new buffer.
147/ "H_DigiPLC" is changed to the new dialogue in the PLC section (see doc).
status DB works

sources: http://pagesperso-orange.fr/HLaidet/Digibutler.htm

If someone wants to work with ARM7 on ARMee board, the project is here:
http://pagesperso-orange.fr/HLaidet/Armee.htm

Greetings, Henri

patxigo

22 posts

Occasional Visitor
Occasional Visitor

Read post 30-12-2009 09:11

Great work Henri,

i have downloaded your software and have tried it.

I have a question, Why don't you use the RTOS to create tasks?

Is it difficult?
I have created one task and it is running well.

Thanks

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 30-12-2009 23:08

Hello, patxigo

when i began with digibutler, i use TK_NEWTASK().
but each task requires memory for stack.
there is only 0x8000 bytes of RAM in the kirin2.
the minimum tasks is:
- Netmain with 0x500 bytes stack
- clock tick 0x300
- http server 0x880
- console 0x400

every option (validated in "ipport.h") needs RAM.

with 1 or 2 option, the soft CRASHED.
that's why i inserted all pocess in http server task.

you can use the command "memory" to know how many bytes remain.

don't forget that every connected socket uses 0x110 bytes.
and ONE client (IE or FireFox) uses 3 or 4 simultaneous sockets at the same time.


Greetings, Henri

patxigo

22 posts

Occasional Visitor
Occasional Visitor

Read post 31-12-2009 08:07

Thanks Henri,

I'll take in account this issue.
i have done a simple task but as you say there are RAM requirements.

So I will probably use your same method.
you have much more expecience.

Regards.

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 07-11-2010 15:57

Hello,

Digibutler following

----- V2.5 ----- 2010 02 10 BUG SNTP
Fix bug when leap year (found by Werner Kurzbauer)

----- V2.6 ----- 2010 11 04 FlexCAN
Here is a CAN bus monitoring (coming from DigibutlerK3).

Hardware:
MCF52231 pins 79 and 80 (SCL, SDA) can be used as CAN bus (secondary function).
We only have to add a CAN transceiver (SN65HVD232D) because DB can't drive directly CAN bus.
See schema electronic "Doc\Ext_CAN_sch.pdf".
It is easy to use the SN65HVD232D with an adaptor SO8 (Farnell)

Software:
There are 2 parts:
- A server reading and dating CAN messages
- A client : HMI on PC

The FlexCAN is configured with 2 RX mailboxes accepting all IDs, and 1 TX mailbox.
All received messages (IRQ) are dated (microsecond) and stored in a FIFO.
the server waits for the client ("H_CANdiag") connection and executes the requests:
- Set bitrate
- Start sampling
- Stop sampling
- Read messages in FIFO
- Write one message

Source code in "CAN_svr.c", "CAN_lowlevel.c" and "CAN.h"
Activ or not with #define HL_FLEXCAN_SVR 1 in "ipport.h"

Don't forget: the project is still CodeWarrior 7.1 with "Parameter Passing"=Standard

The client "H_CANdiag" ("Microsoft Visual C++ 2008 Express Edition" project)
it controls the server and displays all messages (dated in microseconds)
see "H_CANdiag" doc

sources:
http://hlaidet.pagesperso-orange.fr/Digibutler.htm
http://hlaidet.pagesperso-orange.fr/H_CANdiag.htm

Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 03-12-2010 10:49

Hello,

Digibutler following

----- V2.7 ----- 2010 12 02 CANopen Slave

You want to build your own CANopen Remote IO unit.
Here is an implementation of CANopen Slave on Digibutler.

When i looked for informations to realize a CANopen stack, i found the CANopen stack "CanFestival".
This stack is free, licensed with LGPL, wrote by Mr. Edouard TISSERANT.

The stack requires a driver CAN (hardware-specific) and a driver TIMER
- CAN: writing a driver for FlexCAN
- TIMER: using existing timer system handler (1ms)

Of course, you have to make the hardware I described in the last post.

CANopen uses EDS (Electronic Data Sheet) file to configure the node.
For CanFestival, it is the same thing.
The configuration i choosed is:
- 16 Digital Inputs
- 16 Digital Outputs
- 4 Analog Inputs(16 bit)
I wrote the EDS file "CANopen\Dictionary\DigibutlerObj.eds" with "CANeds" (freeware).
Codewarrior doesn't show it (extension .eds is not recognized).

Software:
- CANopen_init() starts FlexCAN driver, and remap IOs in an easy to use interface.
- When CAN messages are received, the driver store them in fifo (not to loose)
- CANopen_check() called from the main HL_task_check() periodicaly in a loop.
it is the CAN messages pump commonly called every <50µs (the max is <250µs if only CANopen activity)
- CANopen_Timer_ISR() updates the IO and runs the CANopen stack.
Soft activ or not with #define HL_CANOPEN in "ipport.h".
CANopen uses more than 0x6800 bytes Flash.

You can see on screenshot the CAN bus activity with 2 Slaves
node 8 = DigibutlerK3
node 7 = Digibutler
ana0 = 0x07e5 pot middle (little endian)
ana1,ana3: = 0 pot min
ana4 = 0x0ff3 pot max

sources:
http://hlaidet.pagesperso-orange.fr/Digibutler.htm


Greetings, Henri

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 27-11-2011 19:13

Hello,

Digibutler following

I wanted to change the software of my Digibutlers without removing them from their box.
So here is a way to do that.

----- V2.8 ----- 2011 09 10 Flash SPI
Hardware:
- Add SPI flash memory 4Mbit Spansion S25FL004K0XMFI040 (Farnell).
- Connect to PortANA0-3 or TIN0-3 see "DigibutlerFLASH_sch.pdf"


Software:
- A server (DEBUG SERVER) allows reprogramming the µC on the fly without BDM pod.
- To enable the functionnality, uncomment #define HL_FLASH_SPI in "ipport.h"
- If you prefer to keep ANA inputs, uncomment #define FLASH_SPI_USE_PTC then TIN0-3 are used
- Flash functions are in "FlashSPI.c"
"FlashSPI_init_SPI", "FlashSPI_EraseSector64K", "FlashSPI_ReadBloc", "FlashSPI_WriteBloc"

The upload of the program is done via the debug server "debug_mon.c"
The client "H_Tools.exe" does (through the server):
1- erase SPI Flash
2- upload the program in the SPI Flash pask after pack.
3- send CRC32 of the new program
4- if the CRC32 is OK, DB reprograms itself.
- Copy the programming function into RAM (the CPU flash will be entirely erased)
- Run the function in RAM
- The "FlashSPI_CanRunInRAM" works without calls.
- - Erase CPU Flash
- - Read SPI Flash 4 bytes each time
- - Programming CPU Flash with DWORD read
- - Repeat until the end
- - Reset (the New progr)

A complete update requires less than 10 seconds
3s client-server to Erase(SPI flash)+Upload+Crc32
7s server to Erase(Main Flash)+Read(SPI Flash)+Write(Main Flash)+Reset

How to use "H_Tools.exe": see "H_Tools_DOC.pdf"

sources:
http://hlaidet.pagesperso-orange.fr/Digibutler.htm

Greetings, Henri

llo

8 posts

Popping In
Popping In

Read post 07-12-2011 19:38

Hoi Henri,

Your Digibutler work looks very nice.

Being new to Digibutler can i ask you a question how to get V30 running.

My Digibutler board is still 100% standard.
The default 1.0 version from Elector is working after fixing the network using a TBLCF.
V30 is also working now after using the 2011-11-27 version and comment some ipport.h settings which are not there jet.

Which SD connector (hardware) can you use? Does a SD connector contain any electronic logic or is it just to connect to the pins?

Kind Regards, Luc

Post edited by llo on 07-12-2011 23:07

HLaidet

61 posts

Frequent Visitor
Frequent Visitor

Read post 08-12-2011 19:42

Hello Luc,

You can use MULTICOMP - MC34459 (Farnell:9186158)
see "HardDigilogger.pdf" (electronic schematic) in "doc" folder.
and "screen" folder

you have 2 ways:
1- SD connector on Port AN (easy)
comment #define STATIC_FFS
uncomment #define SPI_SOFTWARE
comment #define SPI_USE_PTC
2- SD connector on Port TC
comment #define STATIC_FFS
uncomment #define SPI_SOFTWARE
ucomment #define SPI_USE_PTC

Greetings, Henri

llo

8 posts

Popping In
Popping In

Read post 16-12-2011 18:30

Hi Henri,

Many thanks, it is working now using the TC ports.
Spend some time to findout a 4GB card isn't working but when i tried a 1GB card it worked immediately. >= 4GB SD cards seems to use the SDHC specs which probably differs from the SD specs.

Greetings, Luc

patxigo

22 posts

Occasional Visitor
Occasional Visitor

Read post 05-02-2012 08:46

Hello Henri,

I see you haven't change the web page.

Is there any reason to do that?

Can we change the web page in the digibutler to show my web page?

I have tried to change it but it shows the Freecale.

Great work again, Henri.

Please log in to post a reply or subscribe / unsubscribe to topics

Subscribe now

Subscribe to our free
E-weekly Newsletter!

Enter your Email address:

Follow Elektor

      

Act now!

FAQ

Before submitting questions, review our FAQ section!

Bestseller

Microprocessor Design using Verilog HDL

This book is a practical guide to processor design in the real world. It presents the Verilog HDL in an easily digestible fashion and serves as a thorough introduction about reducing a computer architecture and instruction set to practice. 

Package Deals

Elektor Bundles

Check our Package Deals and save money! Discounts up to 19% now available!

Price Slashed

Elektor OSPV

This Open Source People Vehicle is perfect for factory halls, warehouses, hospitals, colleges, schools etc.

Elektor PCBs at 25% OFF